mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 07:20:50 +01:00
Merge branch 'patch-wired-move-rotate' into 'dev'
[patch] wired effect move rotate should allow rotation of furniture occupied by users/bots/pets See merge request morningstar/Arcturus-Community!77
This commit is contained in:
commit
67f4e27904
@ -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);
|
int newRotation = ((item.getRotation() + rotationToAdd) % 8) % (item.getBaseItem().getWidth() > 1 || item.getBaseItem().getLength() > 1 ? 4 : 8);
|
||||||
|
|
||||||
//Verify if rotation result in a valid position
|
//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);
|
item.setRotation(newRotation);
|
||||||
|
|
||||||
if (this.direction == 0) {
|
if (this.direction == 0) {
|
||||||
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
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());
|
room.sendComposer(new FloorItemUpdateComposer(item).compose());
|
||||||
|
for (RoomTile t : tilesToUpdate) {
|
||||||
|
room.updateHabbosAt(t.x, t.y);
|
||||||
|
room.updateBotsAt(t.x, t.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBotsAt(short x, short y) {
|
public void updateBotsAt(short x, short y) {
|
||||||
HabboItem topItem = this.getTopItemAt(x, y);
|
HabboItem topItem = this.getTopItemAt(x, y);
|
||||||
|
|
||||||
THashSet<RoomUnit> roomUnits = new THashSet<>();
|
THashSet<RoomUnit> roomUnits = new THashSet<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user