Merge branch 'fixPrio' into 'master'

Fix human being able to play opponents spells by default

Closes #1700

See merge request core-developers/forge!3649
This commit is contained in:
Michael Kamensky
2021-01-31 05:10:51 +00:00

View File

@@ -211,6 +211,10 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
@Override
public SpellAbility getAbilityToPlay(final Card hostCard, final List<SpellAbility> abilities,
final ITriggerEvent triggerEvent) {
// make sure another human player can't choose opponents cards just because he might see them
if (!hostCard.isInZone(ZoneType.Battlefield) && !hostCard.getOwner().equals(player) && !hostCard.getController().equals(player) && hostCard.mayPlay(player).size() == 0) {
return null;
}
spellViewCache = SpellAbilityView.getMap(abilities);
final SpellAbilityView resultView = getGui().getAbilityToPlay(CardView.get(hostCard),
Lists.newArrayList(spellViewCache.keySet()), triggerEvent);