Fix (sortof) bug with mana abilities that require user input

This commit is contained in:
pfps
2017-05-04 01:36:05 +00:00
parent 67879eb3fe
commit ff50e246c7
3 changed files with 7 additions and 4 deletions

View File

@@ -50,12 +50,15 @@ public class InputQueue extends Observable {
return inputStack.isEmpty() ? null : inputStack.peek();
}
/*pfps sometimes this is being called twice for the same input */
public final void removeInput(final Input inp) {
final Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop();
final Input topMostInput = inputStack.isEmpty() ? null : inputStack.peek();
if (topMostInput != inp) {
System.out.println("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack );
}
} else {
inputStack.pop();
}
updateObservers();
}

View File

@@ -54,4 +54,4 @@ public abstract class InputSyncronizedBase extends InputBase implements InputSyn
}
protected void onStop() { }
}
}