From eb2ecd71324134bfcc7fcb3c6eb432535fba2a21 Mon Sep 17 00:00:00 2001 From: brenoepic Date: Wed, 15 May 2024 02:13:14 +0000 Subject: [PATCH] fix: Prevent false occupancy detection in quick teleport w wireds --- src/main/java/com/eu/habbo/habbohotel/rooms/RoomTile.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTile.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTile.java index d3978d8d..9d42b47e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTile.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTile.java @@ -205,8 +205,11 @@ public class RoomTile { } public boolean hasUnits() { - synchronized (this.units) { - return this.units.size() > 0; + synchronized(this.units) { + if (!this.units.isEmpty()) { + this.units.removeIf(unit -> !unit.getCurrentLocation().equals(this)); + } + return !this.units.isEmpty(); } }