Markers destroy all lasers when broken.
Fix potential NPE markerOrigin.lasers.
This commit is contained in:
parent
bb5b93028f
commit
6cae6fe294
1 changed files with 9 additions and 2 deletions
|
@ -354,13 +354,21 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
entity.setDead();
|
entity.setDead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
markerOrigin.lasers = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (TileWrapper m : o.vect) {
|
for (TileWrapper m : o.vect) {
|
||||||
TileMarker mark = m.getMarker(worldObj);
|
TileMarker mark = m.getMarker(worldObj);
|
||||||
|
|
||||||
if (mark != null) {
|
if (mark != null) {
|
||||||
|
if(mark.lasers != null) {
|
||||||
|
for (EntityBlock entity : mark.lasers) {
|
||||||
|
if (entity != null) {
|
||||||
|
entity.setDead();
|
||||||
|
}
|
||||||
|
}
|
||||||
mark.lasers = null;
|
mark.lasers = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (mark != this) {
|
if (mark != this) {
|
||||||
mark.origin = new Origin();
|
mark.origin = new Origin();
|
||||||
|
@ -368,7 +376,6 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
markerOrigin.lasers = null;
|
|
||||||
|
|
||||||
if (markerOrigin != this) {
|
if (markerOrigin != this) {
|
||||||
markerOrigin.origin = new Origin();
|
markerOrigin.origin = new Origin();
|
||||||
|
|
Loading…
Reference in a new issue