Try to Fix IOS Build

This commit is contained in:
Anthony Calosa
2016-06-29 15:03:36 +08:00
parent 975df3625d
commit 27fd1942d0
2 changed files with 25 additions and 16 deletions

View File

@@ -503,6 +503,8 @@ int MTGRevealingCards::receiveEvent(WEvent* e)
CardView* t;
if (event->card->view)
t = NEW CardView(CardView::nullZone, event->card, *(event->card->view));
else
t = NEW CardView(CardView::nullZone, event->card, (float)x, (float)y);
//we store copies of the card view since moving to and from card displays also deletes the guis stored in cards.
//GuiLayer::resetObjects() is the main reason we need to back them up. card views are set to NULL maybe more often than
//they should be, possibly someone being to over cautious.
@@ -510,6 +512,7 @@ int MTGRevealingCards::receiveEvent(WEvent* e)
t->actY = SCREEN_HEIGHT * -2;
//correct cards x and y, last known location was the reveal display.
cards.push_back(t);
return 1;
}
}
return 0;
@@ -832,6 +835,8 @@ int MTGScryCards::receiveEvent(WEvent* e)
CardView* t;
if (event->card->view)
t = NEW CardView(CardView::nullZone, event->card, *(event->card->view));
else
t = NEW CardView(CardView::nullZone, event->card, (float)x, (float)y);
//we store copies of the card view since moving to and from card displays also deletes the guis stored in cards.
//GuiLayer::resetObjects() is the main reason we need to back them up. card views are set to NULL maybe more often than
//they should be, possibly someone being to over cautious.
@@ -839,6 +844,7 @@ int MTGScryCards::receiveEvent(WEvent* e)
t->actY = SCREEN_HEIGHT * -2;
//correct cards x and y, last known location was the reveal display.
cards.push_back(t);
return 1;
}
}
return 0;
@@ -4298,19 +4304,19 @@ ABestow::ABestow(GameObserver* observer, int id, MTGCardInstance * card, MTGCard
_card = card;
}
int ABestow::resolve()
{
if (target)
{
if (_card->hasType("creature"))
{
_card->removeType("creature");
_card->addType("aura");
}
_card->target = (MTGCardInstance*)target;
_card->isBestowed = true;
}
return 1;
int ABestow::resolve()
{
if (target)
{
if (_card->hasType("creature"))
{
_card->removeType("creature");
_card->addType("aura");
}
_card->target = (MTGCardInstance*)target;
_card->isBestowed = true;
}
return 1;
}
const string ABestow::getMenuText()

View File

@@ -32,7 +32,8 @@ void GameObserver::cleanup()
SAFE_DELETE(replacementEffects);
for (size_t i = 0; i < players.size(); ++i)
{
SAFE_DELETE(players[i]);
if(players[i])
SAFE_DELETE(players[i]);
}
players.clear();
@@ -60,7 +61,8 @@ GameObserver::~GameObserver()
for (size_t i = 0; i < players.size(); ++i)
{
players[i]->End();
if(players[i])
players[i]->End();
}
SAFE_DELETE(targetChooser);
SAFE_DELETE(mLayers);
@@ -68,7 +70,8 @@ GameObserver::~GameObserver()
SAFE_DELETE(replacementEffects);
for (size_t i = 0; i < players.size(); ++i)
{
SAFE_DELETE(players[i]);
if(players[i])
SAFE_DELETE(players[i]);
}
players.clear();
delete[] ExtraRules;