From 66f047bb5333d28c9d4645758e685800280059b1 Mon Sep 17 00:00:00 2001 From: skeletor Date: Wed, 22 Jan 2020 10:22:05 -0500 Subject: [PATCH] [patch] wired effect move rotate should allow rotation of furniture occupied by users/bots/pets --- .../wired/effects/WiredEffectMoveRotateFurni.java | 9 +++++++-- src/main/java/com/eu/habbo/habbohotel/rooms/Room.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java index c261c851..c83fcad7 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java @@ -72,15 +72,20 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect { } int newRotation = ((item.getRotation() + rotationToAdd) % 8) % (item.getBaseItem().getWidth() > 1 || item.getBaseItem().getLength() > 1 ? 4 : 8); - //Verify if rotation result in a valid position - if (rotationToAdd > 0 && room.furnitureFitsAt(room.getLayout().getTile(item.getX(), item.getY()), item, newRotation).equals(FurnitureMovementError.NONE))//room.canPlaceFurnitureAt(item, null, room.getLayout().getTile(item.getX(), item.getY()), item.getRotation() + rotationToAdd)) + FurnitureMovementError rotateError = room.furnitureFitsAt(room.getLayout().getTile(item.getX(), item.getY()), item, newRotation); + if (rotationToAdd > 0 && (rotateError.equals(FurnitureMovementError.TILE_HAS_HABBOS) || rotateError.equals(FurnitureMovementError.TILE_HAS_PETS) || + rotateError.equals(FurnitureMovementError.TILE_HAS_BOTS) || rotateError.equals(FurnitureMovementError.NONE))) { item.setRotation(newRotation); if (this.direction == 0) { tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation())); room.sendComposer(new FloorItemUpdateComposer(item).compose()); + for (RoomTile t : tilesToUpdate) { + room.updateHabbosAt(t.x, t.y); + room.updateBotsAt(t.x, t.y); + } } } 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 a99a9ea6..e88598a7 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -751,7 +751,7 @@ public class Room implements Comparable, ISerialize, Runnable { } } - private void updateBotsAt(short x, short y) { + public void updateBotsAt(short x, short y) { HabboItem topItem = this.getTopItemAt(x, y); THashSet roomUnits = new THashSet<>();