Fix teleports on floorplaneditor

This commit is contained in:
brenoepic 2022-04-11 23:46:05 -03:00
parent 9c4b1df499
commit bad061bfd1
2 changed files with 8 additions and 0 deletions

View File

@ -4480,6 +4480,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
return FurnitureMovementError.MAX_ITEMS;
}
if (tile == null || tile.state == RoomTileState.INVALID) {
return FurnitureMovementError.INVALID_MOVE;
}
rotation %= 8;
if (this.hasRights(habbo) || this.getGuildRightLevel(habbo).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS) || habbo.hasPermission(Permission.ACC_MOVEROTATE)) {
return FurnitureMovementError.NONE;

View File

@ -51,6 +51,10 @@ class TeleportActionThree implements Runnable {
RoomTile teleportLocation = targetRoom.getLayout().getTile(targetTeleport.getX(), targetTeleport.getY());
if (teleportLocation == null) {
Emulator.getThreading().run(new TeleportActionFive(this.currentTeleport, this.room, this.client), 0);
return;
}
this.client.getHabbo().getRoomUnit().setLocation(teleportLocation);
this.client.getHabbo().getRoomUnit().getPath().clear();
this.client.getHabbo().getRoomUnit().removeStatus(RoomUnitStatus.MOVE);