From 9b076d6791eda788439b26a634868f35858c43f1 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Mon, 7 Feb 2011 13:29:27 +0000 Subject: [PATCH] removed a fix to an infinate loop bug with Ai using cards such as inkmoth nexus... as it removed ais ability to momir...protip in MTG youre not allowed to interrupt your own abilities...the way momir is working now, it select an action that doesnt pass priority instead it instantly searchs for a momir ability...which is wrong... --- projects/mtg/src/AIPlayer.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index a6a7f50d6..946bbe404 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -1496,7 +1496,6 @@ void AIPlayer::Render() int AIPlayerBaka::Act(float dt) { GameObserver * g = GameObserver::GetInstance(); - if (!(g->currentlyActing() == this)) { return 0; @@ -1541,29 +1540,6 @@ int AIPlayerBaka::Act(float dt) action->Act(); SAFE_DELETE(action); clickstream.pop(); - if (clickstream.empty()) - { - //check if we're done executing our actions - //then if we were interrupting cancel the offer - //or request next game phase. - //this help relieve the ai in edge cases where it can still trip over it's own clickstream - //as exhabited when multiple inkmoth's are in play without this condiational. - if (g->isInterrupting == this) - { - g->mLayers->stackLayer()->cancelInterruptOffer(); //endOfInterruption(); - //this brings us inline with MTG rules. as we shouldnt be able to interrupt our own action. - } - else - { - g->userRequestNextGamePhase(); - //this does not impact the amount of cards ai will play in a phase as - //we can only go ahead with a request for next phase if nothing is happening. - //ei: nothing on stack, nothing waiting for targets ect. - //what this does is safegaurd against ai getting trapped in a loop - //where it tries to repeatedly cast an ability it cant afford - //such as inkmoth lands, "becomes" ability which it find just too tempting. - } - } } return 1; }