From 6cae6fe294a92b928a50f66078f8c75ece8232e8 Mon Sep 17 00:00:00 2001 From: tcooc Date: Sun, 4 Nov 2012 03:38:30 -0500 Subject: [PATCH] Markers destroy all lasers when broken. Fix potential NPE markerOrigin.lasers. --- common/buildcraft/builders/TileMarker.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/builders/TileMarker.java b/common/buildcraft/builders/TileMarker.java index 163e47eb..e0fe6c07 100644 --- a/common/buildcraft/builders/TileMarker.java +++ b/common/buildcraft/builders/TileMarker.java @@ -354,13 +354,21 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { entity.setDead(); } } + markerOrigin.lasers = null; } for (TileWrapper m : o.vect) { TileMarker mark = m.getMarker(worldObj); if (mark != null) { - mark.lasers = null; + if(mark.lasers != null) { + for (EntityBlock entity : mark.lasers) { + if (entity != null) { + entity.setDead(); + } + } + mark.lasers = null; + } if (mark != this) { mark.origin = new Origin(); @@ -368,7 +376,6 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider { } } - markerOrigin.lasers = null; if (markerOrigin != this) { markerOrigin.origin = new Origin();