mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
game: added runtime check for empty choice dialogs
This commit is contained in:
parent
f6e625de72
commit
da89ab6ad7
1 changed files with 7 additions and 0 deletions
|
|
@ -467,6 +467,13 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (choice.isKeyChoice() && choice.getKeyChoices().isEmpty()) {
|
||||||
|
throw new IllegalArgumentException("Wrong code usage. Key choices must contains some values");
|
||||||
|
}
|
||||||
|
if (!choice.isKeyChoice() && choice.getChoices().isEmpty()) {
|
||||||
|
throw new IllegalArgumentException("Wrong code usage. Choices must contains some values");
|
||||||
|
}
|
||||||
|
|
||||||
// Try to autopay for mana
|
// Try to autopay for mana
|
||||||
if (Outcome.PutManaInPool == outcome && currentlyUnpaidMana != null) {
|
if (Outcome.PutManaInPool == outcome && currentlyUnpaidMana != null) {
|
||||||
// Check check if the spell being paid for cares about the color of mana being paid
|
// Check check if the spell being paid for cares about the color of mana being paid
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue