mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Merge pull request #3629 from Card-Forge/kevlahnota-patch-8
Update AiController.java
This commit is contained in:
@@ -1197,16 +1197,17 @@ public class AiController {
|
||||
}
|
||||
|
||||
public boolean confirmAction(SpellAbility sa, PlayerActionConfirmMode mode, String message, Map<String, Object> params) {
|
||||
if (mode == PlayerActionConfirmMode.AlternativeDamageAssignment) {
|
||||
if (mode == PlayerActionConfirmMode.AlternativeDamageAssignment || mode == PlayerActionConfirmMode.ChangeZoneToAltDestination) {
|
||||
System.err.printf("Overriding AI confirmAction decision for %s, defaulting to true.\n", mode);
|
||||
return true;
|
||||
}
|
||||
|
||||
ApiType api = sa.getApi();
|
||||
ApiType api = sa == null ? null : sa.getApi();
|
||||
|
||||
// Abilities without api may also use this routine, However they should provide a unique mode value ?? How could this work?
|
||||
if (api == null) {
|
||||
String exMsg = String.format("AI confirmAction does not know what to decide about %s mode (api is null).",
|
||||
mode);
|
||||
if (sa == null || api == null) {
|
||||
String exMsg = String.format("AI confirmAction does not know what to decide about %s mode (%s is null).",
|
||||
mode, sa == null ? "SA" : "API");
|
||||
throw new IllegalArgumentException(exMsg);
|
||||
}
|
||||
return SpellApiToAi.Converter.get(api).confirmAction(player, sa, mode, message, params);
|
||||
|
||||
Reference in New Issue
Block a user