mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Prevent abilities being put on the Undo stack if not activated by Gui player
This commit is contained in:
@@ -282,4 +282,7 @@ public abstract class PlayerController {
|
||||
// better to have this odd method than those if playerType comparison in ChangeZone
|
||||
public abstract Card chooseSingleCardForZoneChange(ZoneType destination, List<ZoneType> origin, SpellAbility sa, List<Card> fetchList, String selectPrompt, boolean b, Player decider);
|
||||
|
||||
public boolean isGuiPlayer() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,9 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
System.out.println(source.getName() + " - activatingPlayer not set before adding to stack.");
|
||||
}
|
||||
|
||||
if (sp.isUndoable()) { //either push onto or clear undo stack based on where spell/ability is undoable
|
||||
//either push onto or clear undo stack based on whether
|
||||
//spell/ability is undoable and activator is the Gui player
|
||||
if (sp.isUndoable() && activator.getController().isGuiPlayer()) {
|
||||
undoStack.push(sp);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1165,4 +1165,7 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
return chooseSingleEntityForEffect(fetchList, sa, selectPrompt, b, decider);
|
||||
}
|
||||
|
||||
public boolean isGuiPlayer() {
|
||||
return lobbyPlayer == GuiBase.getInterface().getGuiPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user