Fixed rollers causing dead tiles and wired recognizing user on roller

This commit is contained in:
Yordi 2024-10-16 10:30:31 +02:00
parent 0a6355996a
commit 71aa4d8676

View File

@ -1498,11 +1498,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
if (unit.hasStatus(RoomUnitStatus.MOVE))
continue;
RoomTile tile = tileInFront.copy();
tile.setStackHeight(unit.getZ() + zOffset);
double newZ = unit.getZ() + zOffset;
if (roomUserRolledEvent != null && unit.getRoomUnitType() == RoomUnitType.USER) {
roomUserRolledEvent = new UserRolledEvent(getHabbo(unit), roller, tile);
roomUserRolledEvent = new UserRolledEvent(getHabbo(unit), roller, tileInFront);
Emulator.getPluginManager().fireEvent(roomUserRolledEvent);
if (roomUserRolledEvent.isCancelled())
@ -1517,10 +1516,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
RideablePet riding = rollingHabbo.getHabboInfo().getRiding();
if (riding != null) {
RoomUnit ridingUnit = riding.getRoomUnit();
tile.setStackHeight(ridingUnit.getZ() + zOffset);
newZ = ridingUnit.getZ() + zOffset;
rolledUnitIds.add(ridingUnit.getId());
updatedUnit.remove(ridingUnit);
messages.add(new RoomUnitOnRollerComposer(ridingUnit, roller, ridingUnit.getCurrentLocation(), ridingUnit.getZ(), tile, tile.getStackHeight(), room));
messages.add(new RoomUnitOnRollerComposer(ridingUnit, roller, ridingUnit.getCurrentLocation(), ridingUnit.getZ(), tileInFront, newZ, room));
isRiding = true;
}
}
@ -1529,7 +1528,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
usersRolledThisTile.add(unit.getId());
rolledUnitIds.add(unit.getId());
updatedUnit.remove(unit);
messages.add(new RoomUnitOnRollerComposer(unit, roller, unit.getCurrentLocation(), unit.getZ() + (isRiding ? 1 : 0), tile, tile.getStackHeight() + (isRiding ? 1 : 0), room));
messages.add(new RoomUnitOnRollerComposer(unit, roller, unit.getCurrentLocation(), unit.getZ() + (isRiding ? 1 : 0), tileInFront, newZ + (isRiding ? 1 : 0), room));
if (itemsOnRoller.isEmpty()) {
HabboItem item = room.getTopItemAt(tileInFront.x, tileInFront.y);
@ -4553,7 +4552,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
for (HabboItem area : this.getRoomSpecialTypes().getItemsOfType(InteractionBuildArea.class)) {
if (((InteractionBuildArea) area).inSquare(tile) && ((InteractionBuildArea) area).isBuilder(habbo.getHabboInfo().getUsername())) {
return FurnitureMovementError.NONE;
return FurnitureMovementError.NONE;
}
}