Fix a crash with Laser Relays on certain machiens

Closes #445
This commit is contained in:
Ellpeck 2016-12-04 16:03:47 +01:00
parent edffceb500
commit f4cc6ef6f5

View file

@ -67,9 +67,10 @@ public final class TeslaUtil{
TESLA_MAP.put(tile, handlers); TESLA_MAP.put(tile, handlers);
} }
int side = facing == null ? 0 : facing.ordinal(); EnumFacing properFacing = facing == null ? EnumFacing.DOWN : facing;
int side = properFacing.ordinal();
if(handlers[side] == null){ if(handlers[side] == null){
handlers[side] = new TileTeslaWrapper(tile, facing); handlers[side] = new TileTeslaWrapper(tile, properFacing);
} }
return handlers[side]; return handlers[side];
} }