From 5781060d832344958d0a939a4c093dd87a922160 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Sat, 14 Nov 2009 08:28:29 +0000 Subject: [PATCH] Erwan - fix issue 179 (@movedTo battlefield triggers when a creature changes controller) - fix issue 176 (Ray of Command) --- projects/mtg/bin/Res/test/_tests.txt | 2 ++ .../test/{bugs => generic}/triggers_at_movedto_i179.txt | 0 .../mtg/bin/Res/test/{bugs => }/ray_of_command_i176.txt | 0 projects/mtg/include/AllAbilities.h | 9 ++++++++- 4 files changed, 10 insertions(+), 1 deletion(-) rename projects/mtg/bin/Res/test/{bugs => generic}/triggers_at_movedto_i179.txt (100%) rename projects/mtg/bin/Res/test/{bugs => }/ray_of_command_i176.txt (100%) diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 59e29c5b8..a135da3bd 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -37,6 +37,7 @@ generic/tokens.txt generic/trample.txt generic/trample_vs_indestructible.txt generic/trample_vs_multiblock.txt +generic/triggers_at_movedto_i179.txt generic/wither.txt ######################## #Specific Cards @@ -215,6 +216,7 @@ pygmy_troll.txt pyroclasm.txt rampant_growth.txt ray_of_command.txt +ray_of_command_i176.txt reclusive_wight.txt reclusive_wight2.txt recover.txt diff --git a/projects/mtg/bin/Res/test/bugs/triggers_at_movedto_i179.txt b/projects/mtg/bin/Res/test/generic/triggers_at_movedto_i179.txt similarity index 100% rename from projects/mtg/bin/Res/test/bugs/triggers_at_movedto_i179.txt rename to projects/mtg/bin/Res/test/generic/triggers_at_movedto_i179.txt diff --git a/projects/mtg/bin/Res/test/bugs/ray_of_command_i176.txt b/projects/mtg/bin/Res/test/ray_of_command_i176.txt similarity index 100% rename from projects/mtg/bin/Res/test/bugs/ray_of_command_i176.txt rename to projects/mtg/bin/Res/test/ray_of_command_i176.txt diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index aedf4c0b4..6704f98ee 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -112,6 +112,13 @@ public: if (!e) return 0; if (!toTc->canTarget(e->card)) return 0; if (fromTc && !fromTc->targetsZone(e->from)) return 0; + + //Battlefield is a special case. We usually don't want to trigger when a card comes from battlefield to battlefield + // http://code.google.com/p/wagic/issues/detail?id=179 + if ((e->from == game->players[0]->game->battlefield || e->from == game->players[1]->game->battlefield) && + (e->to == game->players[0]->game->battlefield || e->to == game->players[1]->game->battlefield)) { + return 0; + } return 1; } @@ -3954,7 +3961,7 @@ class AInstantControlSteal: public InstantAbility{ AInstantControlSteal(int _id , MTGCardInstance * _source, MTGCardInstance * _target):InstantAbility(_id, _source, _target){ TrueController = _target->controller(); TheftController = source->controller(); - MTGCardInstance * copy = _target->changeController(game->currentlyActing()); + MTGCardInstance * copy = _target->changeController(TheftController); target = copy; source->target = copy; copy->summoningSickness = 0;