Fix bot teleporting with wireds (fixes #315)

This commit is contained in:
Alejandro 2020-01-24 19:52:58 +02:00
parent 35f13902ce
commit f695f2f5b4
2 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,7 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
int currentEffect = bot.getRoomUnit().getEffectId(); int currentEffect = bot.getRoomUnit().getEffectId();
room.giveEffect(bot.getRoomUnit(), 4, -1); room.giveEffect(bot.getRoomUnit(), 4, -1);
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, bot.getRoomUnit()), WiredHandler.TELEPORT_DELAY + 1000); Emulator.getThreading().run(() -> room.giveEffect(bot.getRoomUnit(), 0, -1), WiredHandler.TELEPORT_DELAY + 1000);
Emulator.getThreading().run(new RoomUnitTeleport(bot.getRoomUnit(), room, item.getX(), item.getY(), item.getZ() + item.getBaseItem().getHeight() + (item.getBaseItem().allowSit() ? -0.50 : 0D), currentEffect), WiredHandler.TELEPORT_DELAY); Emulator.getThreading().run(new RoomUnitTeleport(bot.getRoomUnit(), room, item.getX(), item.getY(), item.getZ() + item.getBaseItem().getHeight() + (item.getBaseItem().allowSit() ? -0.50 : 0D), currentEffect), WiredHandler.TELEPORT_DELAY);
break; break;
} else { } else {

View File

@ -55,6 +55,7 @@ public class RoomUnitTeleport implements Runnable {
this.room.sendComposer(teleportMessage); this.room.sendComposer(teleportMessage);
this.room.updateHabbosAt(t.x, t.y); this.room.updateHabbosAt(t.x, t.y);
this.room.updateBotsAt(t.x, t.y);
topItem = room.getTopItemAt(x, y); topItem = room.getTopItemAt(x, y);
if (topItem != null && roomUnit.getCurrentLocation().equals(room.getLayout().getTile((short) x, (short) y))) { if (topItem != null && roomUnit.getCurrentLocation().equals(room.getLayout().getTile((short) x, (short) y))) {