fix hang aicode ability controller
aicode should be dedicated for AI only...
This commit is contained in:
@@ -54,6 +54,18 @@ GenericRevealAbility::GenericRevealAbility(GameObserver* observer, int id, MTGCa
|
||||
|
||||
int GenericRevealAbility::resolve()
|
||||
{
|
||||
if(source->lastController->isAI() && source->getAICustomCode().size())
|
||||
{
|
||||
string abi = source->getAICustomCode();
|
||||
std::transform(abi.begin(), abi.end(), abi.begin(), ::tolower);//fix crash
|
||||
AbilityFactory af(game);
|
||||
MTGAbility * a3 = af.parseMagicLine(abi, this->GetId(), NULL, source);
|
||||
a3->oneShot = 1;
|
||||
a3->canBeInterrupted = false;
|
||||
a3->resolve();
|
||||
SAFE_DELETE(a3);
|
||||
return 1;
|
||||
}
|
||||
MTGAbility * ability = NEW MTGRevealingCards(game, this->GetId(), source, howMany);
|
||||
ability->addToGame();
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user