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 5e87ce8e..af82a1ae 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3962,7 +3962,7 @@ public class Room implements Comparable, ISerialize, Runnable { return; this.sendComposer(new RoomRemoveRightsListComposer(this, userId).compose()); - + if (this.rights.remove(userId)) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ? AND user_id = ?")) { statement.setInt(1, this.id); @@ -3974,6 +3974,7 @@ public class Room implements Comparable, ISerialize, Runnable { } if (habbo != null) { + this.ejectUserFurni(habbo.getHabboInfo().getId()); habbo.getRoomUnit().setRightsLevel(RoomRightLevels.NONE); habbo.getRoomUnit().removeStatus(RoomUnitStatus.FLAT_CONTROL); this.refreshRightsForHabbo(habbo); @@ -3981,6 +3982,10 @@ public class Room implements Comparable, ISerialize, Runnable { } public void removeAllRights() { + for (int userId : rights.toArray()) { + this.ejectUserFurni(userId); + } + this.rights.clear(); try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ?")) {