Fix WiredEffectTriggerStacks NPE.

This commit is contained in:
KrewsOrg 2020-04-23 16:06:17 +01:00
parent f261e8c10c
commit fc6dd9790d

View File

@ -102,7 +102,7 @@ public class WiredEffectTriggerStacks extends InteractionWiredEffect {
@Override
public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) {
if (stuff != null && stuff.length >= 1 && stuff[stuff.length - 1] instanceof WiredEffectTriggerStacks) {
if (stuff == null && stuff.length >= 1 && stuff[stuff.length - 1] instanceof WiredEffectTriggerStacks) {
return false;
}
@ -126,7 +126,6 @@ public class WiredEffectTriggerStacks extends InteractionWiredEffect {
}
}
}
Object[] newStuff = new Object[stuff.length + 1];
System.arraycopy(stuff, 0, newStuff, 0, stuff.length);
newStuff[newStuff.length - 1] = this;
@ -135,6 +134,7 @@ public class WiredEffectTriggerStacks extends InteractionWiredEffect {
return true;
}
@Override
public String getWiredData() {
StringBuilder wiredData = new StringBuilder(this.getDelay() + "\t");