mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Merge branch 'fix-onwalkon-exploit' into 'dev'
Fixed weird edge-case teleporting loop with wired. See merge request morningstar/Arcturus-Community!225
This commit is contained in:
commit
3b7f87e4a9
@ -47,14 +47,20 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
|
||||
|
||||
Room room = roomUnit.getRoom();
|
||||
|
||||
if (room == null)
|
||||
if (room == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// makes a temporary effect
|
||||
|
||||
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
|
||||
room.sendComposer(new RoomUserEffectComposer(roomUnit, 4).compose());
|
||||
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), WiredHandler.TELEPORT_DELAY + 1000);
|
||||
|
||||
if (tile == roomUnit.getCurrentLocation()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (tile.state == RoomTileState.INVALID || tile.state == RoomTileState.BLOCKED) {
|
||||
RoomTile alternativeTile = null;
|
||||
List<RoomTile> optionalTiles = room.getLayout().getTilesAround(tile);
|
||||
@ -146,6 +152,7 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
|
||||
if (!this.items.isEmpty()) {
|
||||
int i = Emulator.getRandom().nextInt(this.items.size());
|
||||
HabboItem item = this.items.get(i);
|
||||
|
||||
teleportUnitToTile(roomUnit, room.getLayout().getTile(item.getX(), item.getY()));
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user