mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
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:
@@ -211,6 +211,10 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
@Override
|
@Override
|
||||||
public SpellAbility getAbilityToPlay(final Card hostCard, final List<SpellAbility> abilities,
|
public SpellAbility getAbilityToPlay(final Card hostCard, final List<SpellAbility> abilities,
|
||||||
final ITriggerEvent triggerEvent) {
|
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);
|
spellViewCache = SpellAbilityView.getMap(abilities);
|
||||||
final SpellAbilityView resultView = getGui().getAbilityToPlay(CardView.get(hostCard),
|
final SpellAbilityView resultView = getGui().getAbilityToPlay(CardView.get(hostCard),
|
||||||
Lists.newArrayList(spellViewCache.keySet()), triggerEvent);
|
Lists.newArrayList(spellViewCache.keySet()), triggerEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user