Refactored restore state code, added additional error check for mana undo param;

This commit is contained in:
Oleg Agafonov 2020-08-06 22:17:37 +04:00
parent 2eeefd91ef
commit 83f7ae377a
12 changed files with 64 additions and 40 deletions

View file

@ -108,7 +108,7 @@ public class DoIfCostPaid extends OneShotEffect {
player.resetStoredBookmark(game); // otherwise you can e.g. undo card drawn with Mentor of the Meek
} else {
// Paying cost was cancels so try to undo payment so far
game.restoreState(bookmark, DoIfCostPaid.class.getName());
player.restoreState(bookmark, DoIfCostPaid.class.getName(), game);
if (!otherwiseEffects.isEmpty()) {
for (Effect effect : otherwiseEffects) {
effect.setTargetPointer(this.targetPointer);