- Fix for issue 650 (tidal Warrior effect doesn't end at end of turn)

- Fix PSP compilation
This commit is contained in:
wagic.the.homebrew
2011-05-07 04:10:47 +00:00
parent 062d5f9485
commit f96635541d
8 changed files with 50 additions and 2 deletions
+5
View File
@@ -28,6 +28,11 @@ int ActionLayer::removeFromGame(ActionElement * e)
if (isWaitingForAnswer() == e)
setCurrentWaitingAction(NULL);
e->destroy();
i = getIndexOf(e); //the destroy event might have changed the contents of mObjects, so we get the index again
if (i == -1)
return 0; //Should not happen, it means we deleted thesame object twice?
mObjects.erase(mObjects.begin() + i);
mCount--;
return 1;
+12
View File
@@ -2163,11 +2163,23 @@ int MultiAbility::addToGame()
MTGAbility * a = abilities[i]->clone();
a->target = target;
a->addToGame();
clones.push_back(a);
}
MTGAbility::addToGame();
return 1;
}
int MultiAbility::destroy()
{
for (size_t i = 0; i < clones.size(); ++i)
{
//I'd like to call game->removeObserver here instead of using forceDestroy, but I get a weird crash after that, need to investigate a bit
clones[i]->forceDestroy = 1;
}
clones.clear();
return ActivatedAbility::destroy();
}
const char * MultiAbility::getMenuText()
{
if (abilities.size())
+1 -1
View File
@@ -448,7 +448,7 @@ void StatsWrapper::updateStats(DeckDataWrapper *myDeck)
//but through a rule that is outside of the primitives. This block is a hack to address this
const int colors[] = {Constants::MTG_COLOR_GREEN, Constants::MTG_COLOR_BLUE, Constants::MTG_COLOR_RED, Constants::MTG_COLOR_BLACK, Constants::MTG_COLOR_WHITE};
const string lands[] = { "forest", "island", "mountain", "swamp", "plains" };
for (int i = 0; i < sizeof(colors)/sizeof(colors[0]); ++i)
for (unsigned int i = 0; i < sizeof(colors)/sizeof(colors[0]); ++i)
{
int colorId = colors[i];
string type = lands[i];
+6
View File
@@ -491,6 +491,12 @@ int TestSuite::assertGame()
sprintf(result, "<span class=\"error\">==Mana problem. Was expecting %i but got %i for player %i==</span><br />",
endState.playerData[i].manapool->getConvertedCost(), p->getManaPool()->getConvertedCost(), i);
Log(result);
if ( endState.playerData[i].manapool->getConvertedCost() == p->getManaPool()->getConvertedCost())
{
sprintf(result, "<span class=\"error\">====(Apparently Mana Color issues since converted cost is the same)==</span><br />");
Log(result);
}
error++;
}
+1 -1
View File
@@ -264,7 +264,7 @@ bool WCFilterProducesColor::isMatch(MTGCard * c)
//Basic lands are not producing their mana through regular abilities anymore,
//but through a rule that is outside of the primitives. This block is a hack to address this
const string lands[] = { "dummy(colorless)", "forest", "island", "mountain", "swamp", "plains" };
if ((color < sizeof(lands)/sizeof(lands[0])) && c->data->hasType(lands[color].c_str()))
if ((color < (int)(sizeof(lands)/sizeof(lands[0]))) && c->data->hasType(lands[color].c_str()))
return true;
//Retrieve non basic Mana abilities