Fixed various Word of Command bugs, implemented mana pool restore methods

This commit is contained in:
L_J 2018-06-04 14:30:37 +02:00 committed by GitHub
parent 9a5b574c0c
commit cb7c222eb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 41 deletions

View file

@ -36,17 +36,12 @@ public class SpellStack extends ArrayDeque<StackObject> {
StackObject top = null;
try {
top = this.peek();
Spell topSpell = getSpell(top.getId());
if (topSpell != null) {
top.resolve(game);
game.resetControlAfterSpellResolve(topSpell);
} else {
top.resolve(game);
}
top.resolve(game);
game.resetControlAfterSpellResolve(top.getId());
} finally {
if (top != null) {
if (contains(top)) {
logger.warn("StackObject was still on the stack after resoving" + top.getName());
logger.warn("StackObject was still on the stack after resolving" + top.getName());
this.remove(top, game);
}
}