mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-19 07:56:26 +01:00
Fix unable to use teleport when item blocking
This commit is contained in:
parent
3c4782ef3d
commit
f42959fd4d
@ -93,7 +93,7 @@ public class InteractionTeleport extends HabboItem {
|
|||||||
// set state 1 and walk on item
|
// set state 1 and walk on item
|
||||||
this.roomUnitID = unit.getId();
|
this.roomUnitID = unit.getId();
|
||||||
this.setExtradata("1");
|
this.setExtradata("1");
|
||||||
room.updateItem(this);
|
room.updateItemState(this);
|
||||||
unit.setGoalLocation(infrontTile);
|
unit.setGoalLocation(infrontTile);
|
||||||
|
|
||||||
List<Runnable> onSuccess = new ArrayList<Runnable>();
|
List<Runnable> onSuccess = new ArrayList<Runnable>();
|
||||||
@ -111,7 +111,7 @@ public class InteractionTeleport extends HabboItem {
|
|||||||
walkable = this.getBaseItem().allowWalk();
|
walkable = this.getBaseItem().allowWalk();
|
||||||
room.updateTile(currentLocation);
|
room.updateTile(currentLocation);
|
||||||
this.setExtradata("0");
|
this.setExtradata("0");
|
||||||
room.updateItem(this);
|
room.updateItemState(this);
|
||||||
this.roomUnitID = -1;
|
this.roomUnitID = -1;
|
||||||
unit.removeOverrideTile(currentLocation);
|
unit.removeOverrideTile(currentLocation);
|
||||||
unit.setCanLeaveRoomByDoor(true);
|
unit.setCanLeaveRoomByDoor(true);
|
||||||
|
@ -726,13 +726,12 @@ public class RoomUnit {
|
|||||||
if (room.getItemsAt(tile).stream().anyMatch(i -> i.canOverrideTile(this, room, tile)))
|
if (room.getItemsAt(tile).stream().anyMatch(i -> i.canOverrideTile(this, room, tile)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int tileIndex = (room.getLayout().getMapSizeY() * tile.y) + tile.x + 1;
|
int tileIndex = (tile.x & 0xFF) | (tile.y << 12);
|
||||||
return this.overridableTiles.contains(tileIndex);
|
return this.overridableTiles.contains(tileIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addOverrideTile(RoomTile tile) {
|
public void addOverrideTile(RoomTile tile) {
|
||||||
if (!this.canOverrideTile(tile)) { return; } // Test if the Tile is overridable
|
int tileIndex = (tile.x & 0xFF) | (tile.y << 12);
|
||||||
int tileIndex = (room.getLayout().getMapSizeY() * tile.y) + tile.x + 1;
|
|
||||||
if (!this.overridableTiles.contains(tileIndex)) {
|
if (!this.overridableTiles.contains(tileIndex)) {
|
||||||
this.overridableTiles.add(tileIndex);
|
this.overridableTiles.add(tileIndex);
|
||||||
}
|
}
|
||||||
@ -741,7 +740,7 @@ public class RoomUnit {
|
|||||||
public void removeOverrideTile(RoomTile tile) {
|
public void removeOverrideTile(RoomTile tile) {
|
||||||
if (room == null || room.getLayout() == null) return;
|
if (room == null || room.getLayout() == null) return;
|
||||||
|
|
||||||
int tileIndex = (room.getLayout().getMapSizeY() * tile.y) + tile.x + 1;
|
int tileIndex = (tile.x & 0xFF) | (tile.y << 12);
|
||||||
this.overridableTiles.remove(tileIndex);
|
this.overridableTiles.remove(tileIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,15 +54,17 @@ class TeleportActionThree implements Runnable {
|
|||||||
this.client.getHabbo().getRoomUnit().setLocation(teleportLocation);
|
this.client.getHabbo().getRoomUnit().setLocation(teleportLocation);
|
||||||
this.client.getHabbo().getRoomUnit().getPath().clear();
|
this.client.getHabbo().getRoomUnit().getPath().clear();
|
||||||
this.client.getHabbo().getRoomUnit().removeStatus(RoomUnitStatus.MOVE);
|
this.client.getHabbo().getRoomUnit().removeStatus(RoomUnitStatus.MOVE);
|
||||||
this.client.getHabbo().getRoomUnit().setZ(targetTeleport.getZ());
|
this.client.getHabbo().getRoomUnit().setZ(teleportLocation.getStackHeight());
|
||||||
this.client.getHabbo().getRoomUnit().setPreviousLocationZ(targetTeleport.getZ());
|
this.client.getHabbo().getRoomUnit().setPreviousLocationZ(teleportLocation.getStackHeight());
|
||||||
this.client.getHabbo().getRoomUnit().setRotation(RoomUserRotation.values()[targetTeleport.getRotation() % 8]);
|
|
||||||
|
|
||||||
if (targetRoom != this.room) {
|
if (targetRoom != this.room) {
|
||||||
this.room.removeHabbo(this.client.getHabbo(), false);
|
this.room.removeHabbo(this.client.getHabbo(), false);
|
||||||
Emulator.getGameEnvironment().getRoomManager().enterRoom(this.client.getHabbo(), targetRoom.getId(), "", Emulator.getConfig().getBoolean("hotel.teleport.locked.allowed"), teleportLocation);
|
Emulator.getGameEnvironment().getRoomManager().enterRoom(this.client.getHabbo(), targetRoom.getId(), "", Emulator.getConfig().getBoolean("hotel.teleport.locked.allowed"), teleportLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.client.getHabbo().getRoomUnit().setRotation(RoomUserRotation.values()[targetTeleport.getRotation() % 8]);
|
||||||
|
this.client.getHabbo().getRoomUnit().statusUpdate(true);
|
||||||
|
|
||||||
targetTeleport.setExtradata("2");
|
targetTeleport.setExtradata("2");
|
||||||
targetRoom.updateItem(targetTeleport);
|
targetRoom.updateItem(targetTeleport);
|
||||||
//targetRoom.updateHabbo(this.client.getHabbo());
|
//targetRoom.updateHabbo(this.client.getHabbo());
|
||||||
|
Loading…
Reference in New Issue
Block a user