Merge branch 'fix-teleports' into 'dev'

Fix teleport bugs

See merge request morningstar/Arcturus-Community!535
This commit is contained in:
Harmonic 2022-04-12 11:18:08 +00:00
commit e8192e3f79
3 changed files with 13 additions and 3 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

@ -12,9 +12,6 @@ public class RequestRoomLoadEvent extends MessageHandler {
String password = this.packet.readString();
if (this.client.getHabbo().getHabboInfo().getLoadingRoom() == 0 && this.client.getHabbo().getHabboStats().roomEnterTimestamp + 1000 < System.currentTimeMillis()) {
if (this.client.getHabbo().getRoomUnit() != null && this.client.getHabbo().getRoomUnit().isTeleporting) {
return;
}
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {
@ -24,6 +21,11 @@ public class RequestRoomLoadEvent extends MessageHandler {
this.client.getHabbo().getHabboInfo().setCurrentRoom(null);
}
if (this.client.getHabbo().getRoomUnit() != null && this.client.getHabbo().getRoomUnit().isTeleporting) {
this.client.getHabbo().getRoomUnit().isTeleporting = false;
}
Emulator.getGameEnvironment().getRoomManager().enterRoom(this.client.getHabbo(), roomId, password);
}
}

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);