Fixed NullPointerException in WiredEffectTeleport

This commit is contained in:
Beny 2019-05-16 10:15:52 +01:00
parent 2842e8993a
commit 6f5806f3fd

View File

@ -120,8 +120,14 @@ public class WiredEffectTeleport extends InteractionWiredEffect
}
public static void teleportUnitToTile(RoomUnit roomUnit, RoomTile tile) {
if(roomUnit == null || tile == null)
return;
Room room = roomUnit.getRoom();
if(room == null)
return;
// makes a temporary effect
room.sendComposer(new RoomUserEffectComposer(roomUnit, 4).compose());
Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), WiredHandler.TELEPORT_DELAY);