From 423211bc704967c9611ee3a6729489e268695b5b Mon Sep 17 00:00:00 2001 From: skeletor Date: Wed, 1 Sep 2021 23:57:15 +0000 Subject: [PATCH] fixed inifnite recursion --- .../java/com/eu/habbo/habbohotel/rooms/Room.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 58321d7d..b4d11cb1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -2671,6 +2671,10 @@ public class Room implements Comparable, 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, 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, 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); }