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();
|
Room room = roomUnit.getRoom();
|
||||||
|
|
||||||
if (room == null)
|
if (room == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// makes a temporary effect
|
// makes a temporary effect
|
||||||
|
|
||||||
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
|
roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit));
|
||||||
room.sendComposer(new RoomUserEffectComposer(roomUnit, 4).compose());
|
room.sendComposer(new RoomUserEffectComposer(roomUnit, 4).compose());
|
||||||
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), WiredHandler.TELEPORT_DELAY + 1000);
|
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) {
|
if (tile.state == RoomTileState.INVALID || tile.state == RoomTileState.BLOCKED) {
|
||||||
RoomTile alternativeTile = null;
|
RoomTile alternativeTile = null;
|
||||||
List<RoomTile> optionalTiles = room.getLayout().getTilesAround(tile);
|
List<RoomTile> optionalTiles = room.getLayout().getTilesAround(tile);
|
||||||
@ -146,6 +152,7 @@ public class WiredEffectTeleport extends InteractionWiredEffect {
|
|||||||
if (!this.items.isEmpty()) {
|
if (!this.items.isEmpty()) {
|
||||||
int i = Emulator.getRandom().nextInt(this.items.size());
|
int i = Emulator.getRandom().nextInt(this.items.size());
|
||||||
HabboItem item = this.items.get(i);
|
HabboItem item = this.items.get(i);
|
||||||
|
|
||||||
teleportUnitToTile(roomUnit, room.getLayout().getTile(item.getX(), item.getY()));
|
teleportUnitToTile(roomUnit, room.getLayout().getTile(item.getX(), item.getY()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user