mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Merge branch 'assorted-fixes' into 'master'
- Fixed the AI for Hunt the Weak/Savage Storm, prevented a crash when trying to exec a trigger with a non-existent SVar See merge request core-developers/forge!130
This commit is contained in:
@@ -55,6 +55,7 @@ public class FightAi extends SpellAbilityAi {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false; // bail at this point, otherwise the AI will overtarget and waste the activation
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.hasParam("TargetsFromDifferentZone")) {
|
if (sa.hasParam("TargetsFromDifferentZone")) {
|
||||||
|
|||||||
@@ -570,6 +570,11 @@ public class TriggerHandler {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (!host.getCurrentState().hasSVar(triggerParams.get("Execute"))) {
|
||||||
|
System.err.println("Warning: tried to run a trigger for card " + host + " referencing a SVar " + triggerParams.get("Execute") + " not present on the current state " + host.getCurrentState() + ". Aborting trigger execution to prevent a crash.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sa = AbilityFactory.getAbility(host, triggerParams.get("Execute"));
|
sa = AbilityFactory.getAbility(host, triggerParams.get("Execute"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user