From b5976035e37d1addf707b41055638d5863873340 Mon Sep 17 00:00:00 2001 From: zethfoxster Date: Sat, 9 Jul 2016 00:58:19 -0400 Subject: [PATCH] actually i changed my mind, instead lets update affinity after events are processed, that should take into account cards untapping,moving, ect.... --- projects/mtg/src/GameObserver.cpp | 3 ++- projects/mtg/src/MTGGameZones.cpp | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 9db6fbdb9..993c9d900 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -1108,7 +1108,7 @@ void GameObserver::Affinity() // DoReduceIncrease = true; //if (!DoReduceIncrease) // continue; - if(!AffinityNeedsUpdate)//we only adjust cost when cards move from anywhere to anywhere. + if(!AffinityNeedsUpdate)//we only adjust cost when events queqes are complete. continue; //above we check if there are even any cards that effect cards manacost //if there are none, leave this function. manacost->copy( is a very expensive funtion @@ -1585,6 +1585,7 @@ int GameObserver::receiveEvent(WEvent * e) SAFE_DELETE(ev); eventsQueue.pop(); } + AffinityNeedsUpdate = true; return result; } diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 18e697aba..8e995dd69 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -328,7 +328,6 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone bool shufflelibrary = card->basicAbilities[(int)Constants::SHUFFLELIBRARYDEATH]; bool inplaytoinplay = false; bool ripToken = false; - g->AffinityNeedsUpdate = true;//we refresh affinity whenever a card is moved from anywhere to anywhere. if (g->players[0]->game->battlefield->hasName("Rest in Peace")||g->players[1]->game->battlefield->hasName("Rest in Peace")) ripToken = true; //Madness or Put in Play...