mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Fix (sortof) bug with mana abilities that require user input
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
encoding/<project>=ISO-8859-1
|
encoding/<project>=UTF-8
|
||||||
|
|||||||
@@ -50,12 +50,15 @@ public class InputQueue extends Observable {
|
|||||||
return inputStack.isEmpty() ? null : inputStack.peek();
|
return inputStack.isEmpty() ? null : inputStack.peek();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*pfps sometimes this is being called twice for the same input */
|
||||||
public final void removeInput(final Input inp) {
|
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) {
|
if (topMostInput != inp) {
|
||||||
System.out.println("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack );
|
System.out.println("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack );
|
||||||
}
|
} else {
|
||||||
|
inputStack.pop();
|
||||||
|
}
|
||||||
updateObservers();
|
updateObservers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,4 +54,4 @@ public abstract class InputSyncronizedBase extends InputBase implements InputSyn
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onStop() { }
|
protected void onStop() { }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user