mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Fix crash where Human needs to sacrifice more permanents than he controls.
This commit is contained in:
@@ -248,8 +248,13 @@ public class PlayerControllerHuman extends PlayerController {
|
|||||||
int max = Math.min(amount, validTargets.size());
|
int max = Math.min(amount, validTargets.size());
|
||||||
if (max <= 0)
|
if (max <= 0)
|
||||||
return new ArrayList<Card>();
|
return new ArrayList<Card>();
|
||||||
|
|
||||||
|
int min = isOptional ? 0 : amount;
|
||||||
|
if (min > max) {
|
||||||
|
min = max;
|
||||||
|
}
|
||||||
|
|
||||||
InputSelectCards inp = new InputSelectCardsFromList(isOptional ? 0 : amount, max, validTargets);
|
InputSelectCards inp = new InputSelectCardsFromList(min, max, validTargets);
|
||||||
// TODO: Either compose a message here, or pass it as parameter from caller.
|
// TODO: Either compose a message here, or pass it as parameter from caller.
|
||||||
inp.setMessage("Select %d " + validMessage + "(s) to sacrifice");
|
inp.setMessage("Select %d " + validMessage + "(s) to sacrifice");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user