This commit is contained in:
asiekierka 2014-11-28 13:52:38 +01:00
parent 9bf2a15ca5
commit 2b2660d245
3 changed files with 14 additions and 3 deletions

View file

@ -92,6 +92,11 @@ public final class Gate implements IGate, IStatementContainer {
}
public void setTrigger(int position, IStatement trigger) {
if (trigger != triggers[position]) {
for (int i = 0; i < triggerParameters[position].length; i++) {
triggerParameters[position][i] = null;
}
}
triggers[position] = trigger;
}
@ -100,7 +105,7 @@ public final class Gate implements IGate, IStatementContainer {
}
public void setAction(int position, IStatement action) {
// HUGE HACK! TODO - Remove in 6.2 API rewrite by adding
// HUGE HACK! TODO - Remove in 6.3 API rewrite by adding
// ways for actions to fix their state on removal.
if (actions[position] instanceof ActionValve && pipe != null && pipe.transport != null) {
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
@ -108,6 +113,12 @@ public final class Gate implements IGate, IStatementContainer {
pipe.transport.allowOutput(side, true);
}
}
if (action != actions[position]) {
for (int i = 0; i < actionParameters[position].length; i++) {
actionParameters[position][i] = null;
}
}
actions[position] = action;
}

View file

@ -51,7 +51,7 @@ public class ActionSignalOutput extends BCStatement implements IActionInternal {
gate.broadcastSignal(color);
for (IStatementParameter param : parameters) {
if (param != null) {
if (param != null && param instanceof ActionParameterSignal) {
ActionParameterSignal signal = (ActionParameterSignal) param;
if (signal.color != null) {

View file

@ -62,7 +62,7 @@ public class TriggerPipeSignal extends BCStatement implements ITriggerInternal {
}
for (IStatementParameter param : parameters) {
if (param != null) {
if (param != null && param instanceof TriggerParameterSignal) {
TriggerParameterSignal signal = (TriggerParameterSignal) param;
if (signal.color != null) {