mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Fix NPE caused by Room.removeHabbo
This commit is contained in:
parent
166d8e8f40
commit
ece55786d8
@ -570,6 +570,9 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
HabboItem lowestChair = this.getLowestChair(tile);
|
HabboItem lowestChair = this.getLowestChair(tile);
|
||||||
THashSet<HabboItem> items = this.getItemsAt(tile);
|
THashSet<HabboItem> items = this.getItemsAt(tile);
|
||||||
if (items == null) return RoomTileState.INVALID;
|
if (items == null) return RoomTileState.INVALID;
|
||||||
|
|
||||||
|
if (items.stream().anyMatch(i -> i.getBaseItem().allowLay())) return RoomTileState.LAY;
|
||||||
|
|
||||||
for (HabboItem item : items) {
|
for (HabboItem item : items) {
|
||||||
if (exclude != null && item == exclude) continue;
|
if (exclude != null && item == exclude) continue;
|
||||||
|
|
||||||
@ -853,10 +856,11 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.loaded) {
|
if (this.loaded) {
|
||||||
if (!this.traxManager.disposed()) {
|
|
||||||
this.traxManager.dispose();
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
|
if (!this.traxManager.disposed()) {
|
||||||
|
this.traxManager.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
this.roomCycleTask.cancel(false);
|
this.roomCycleTask.cancel(false);
|
||||||
this.scheduledTasks.clear();
|
this.scheduledTasks.clear();
|
||||||
this.scheduledComposers.clear();
|
this.scheduledComposers.clear();
|
||||||
@ -936,12 +940,16 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.wordQuiz = "";
|
try {
|
||||||
this.yesVotes = 0;
|
this.wordQuiz = "";
|
||||||
this.noVotes = 0;
|
this.yesVotes = 0;
|
||||||
this.updateDatabaseUserCount();
|
this.noVotes = 0;
|
||||||
this.preLoaded = true;
|
this.updateDatabaseUserCount();
|
||||||
this.layout = null;
|
this.preLoaded = true;
|
||||||
|
this.layout = null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
Emulator.getLogging().logErrorLine(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Emulator.getPluginManager().fireEvent(new RoomUnloadedEvent(this));
|
Emulator.getPluginManager().fireEvent(new RoomUnloadedEvent(this));
|
||||||
@ -2598,13 +2606,15 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
this.sendComposer(new RoomUserRemoveComposer(habbo.getRoomUnit()).compose());
|
this.sendComposer(new RoomUserRemoveComposer(habbo.getRoomUnit()).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
HabboItem item = this.getTopItemAt(habbo.getRoomUnit().getX(), habbo.getRoomUnit().getY());
|
if (habbo.getRoomUnit().getCurrentLocation() != null) {
|
||||||
|
HabboItem item = this.getTopItemAt(habbo.getRoomUnit().getX(), habbo.getRoomUnit().getY());
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
try {
|
try {
|
||||||
item.onWalkOff(habbo.getRoomUnit(), this, new Object[]{});
|
item.onWalkOff(habbo.getRoomUnit(), this, new Object[]{});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Emulator.getLogging().logErrorLine(e);
|
Emulator.getLogging().logErrorLine(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user