mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 00:40:52 +01:00
Optimization on wired teleport
This commit is contained in:
parent
6999db4542
commit
9117065093
@ -150,22 +150,6 @@ public class WiredEffectTeleport extends InteractionWiredEffect
|
||||
}
|
||||
|
||||
Emulator.getThreading().run(new RoomUnitTeleport(roomUnit, room, tile.x, tile.y, tile.getStackHeight() + (tile.state == RoomTileState.SIT ? -0.5 : 0), roomUnit.getEffectId()), WiredHandler.TELEPORT_DELAY);
|
||||
|
||||
Emulator.getThreading().run(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if(roomUnit == null || roomUnit.getRoom() == null)
|
||||
return;
|
||||
|
||||
HabboItem topItem = room.getTopItemAt(roomUnit.getX(), roomUnit.getY());
|
||||
if (topItem != null && roomUnit.getCurrentLocation().equals(room.getLayout().getTile(topItem.getX(), topItem.getY()))) {
|
||||
topItem.onWalkOn(roomUnit, room, new Object[]{});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}, WiredHandler.TELEPORT_DELAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,5 +62,13 @@ public class RoomUnitTeleport implements Runnable
|
||||
this.room.sendComposer(teleportMessage);
|
||||
|
||||
this.room.updateHabbosAt(t.x, t.y);
|
||||
|
||||
topItem = room.getTopItemAt(x, y);
|
||||
if (topItem != null && roomUnit.getCurrentLocation().equals(room.getLayout().getTile((short)x, (short)y))) {
|
||||
try {
|
||||
topItem.onWalkOn(roomUnit, room, new Object[]{});
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user