Merge branch 'patch/infinite-recursion' into 'dev'

fixed inifnite recursion

See merge request morningstar/Arcturus-Community!442
This commit is contained in:
ArpyAge 2021-09-01 23:57:15 +00:00
commit a2781e3a52

View File

@ -2671,6 +2671,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
habbo.getRoomUnit().getCurrentLocation().removeUnit(habbo.getRoomUnit());
}
synchronized (this.roomUnitLock) {
this.currentHabbos.remove(habbo.getHabboInfo().getId());
}
if (sendRemovePacket && habbo.getRoomUnit() != null && !habbo.getRoomUnit().isTeleporting) {
this.sendComposer(new RoomUserRemoveComposer(habbo.getRoomUnit()).compose());
}
@ -2687,10 +2691,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
}
synchronized (this.roomUnitLock) {
this.currentHabbos.remove(habbo.getHabboInfo().getId());
}
if (habbo.getHabboInfo().getCurrentGame() != null) {
if (this.getGame(habbo.getHabboInfo().getCurrentGame()) != null) {
this.getGame(habbo.getHabboInfo().getCurrentGame()).removeHabbo(habbo);
@ -3820,10 +3820,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
public void sendComposer(ServerMessage message) {
for (Habbo habbo : this.getHabbos()) {
if (habbo.getClient() == null) {
this.removeHabbo(habbo, true);
continue;
}
if (habbo.getClient() == null) continue;
habbo.getClient().sendResponse(message);
}