From 4623167b0f608a8322de81b09d96f8642e1b33cd Mon Sep 17 00:00:00 2001 From: Vittorio Alfieri Date: Sat, 9 Oct 2021 13:31:30 +0200 Subject: [PATCH] Fixed the Proliferation and Damageable target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar), fixed a Travis build toolchain error. --- CHANGELOG.md | 4 +++- projects/mtg/src/TargetChooser.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b286c56d..c60225b28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## [master] (https://github.com/WagicProject/wagic/tree/master) ### 09/10/21 -- *Committed:* Fixed the Proliferation and Damageable target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar). ([Vitty85](https://github.com/Vitty85)) +- *Committed:* Fixed the Proliferation and Damageable target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar), fixed a Travis build toolchain error. ([Vitty85](https://github.com/Vitty85)) + +- *Committed:* Fixed the Proliferation and Damageable target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar). https://github.com/WagicProject/wagic/commit/4e18b6d79933b6d437cbdc1f5f007d39553113a2 ([Vitty85](https://github.com/Vitty85)) - *Committed:* Fixed "Tergrid, God of Fright" primitive. https://github.com/WagicProject/wagic/commit/45b077e930b6f649d9116800d31854deced92368 ([Vitty85](https://github.com/Vitty85)) diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index ca6da5847..7e918d8a0 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -1828,11 +1828,11 @@ bool DamageableTargetChooser::canTarget(Targetable * target, bool withoutProtect { if (Player * p = dynamic_cast(target)) { - if (source && (source->controller() != source->controller()->opponent()) && (source->controller()->opponent()->game->inPlay->hasAbility(Constants::CONTROLLERSHROUD)) && source->controller() != target) + if (source && (source->controller() != source->controller()->opponent()) && (source->controller()->opponent()->game->inPlay->hasAbility(Constants::CONTROLLERSHROUD)) && source->controller() != p) return false; - if (source && source->controller()->opponent()->game->inPlay->hasAbility(Constants::PLAYERSHROUD) && source->controller()->opponent() == target) + if (source && source->controller()->opponent()->game->inPlay->hasAbility(Constants::PLAYERSHROUD) && source->controller()->opponent() == p) return false; - if (source && source->controller()->game->inPlay->hasAbility(Constants::PLAYERSHROUD) && source->controller() == target) + if (source && source->controller()->game->inPlay->hasAbility(Constants::PLAYERSHROUD) && source->controller() == p) return false; return true; }