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
+19 -13
View File
@@ -503,6 +503,8 @@ int MTGRevealingCards::receiveEvent(WEvent* e)
CardView* t; CardView* t;
if (event->card->view) if (event->card->view)
t = NEW CardView(CardView::nullZone, event->card, *(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. //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 //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. //they should be, possibly someone being to over cautious.
@@ -510,6 +512,7 @@ int MTGRevealingCards::receiveEvent(WEvent* e)
t->actY = SCREEN_HEIGHT * -2; t->actY = SCREEN_HEIGHT * -2;
//correct cards x and y, last known location was the reveal display. //correct cards x and y, last known location was the reveal display.
cards.push_back(t); cards.push_back(t);
return 1;
} }
} }
return 0; return 0;
@@ -832,6 +835,8 @@ int MTGScryCards::receiveEvent(WEvent* e)
CardView* t; CardView* t;
if (event->card->view) if (event->card->view)
t = NEW CardView(CardView::nullZone, event->card, *(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. //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 //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. //they should be, possibly someone being to over cautious.
@@ -839,6 +844,7 @@ int MTGScryCards::receiveEvent(WEvent* e)
t->actY = SCREEN_HEIGHT * -2; t->actY = SCREEN_HEIGHT * -2;
//correct cards x and y, last known location was the reveal display. //correct cards x and y, last known location was the reveal display.
cards.push_back(t); cards.push_back(t);
return 1;
} }
} }
return 0; return 0;
@@ -4298,19 +4304,19 @@ ABestow::ABestow(GameObserver* observer, int id, MTGCardInstance * card, MTGCard
_card = card; _card = card;
} }
int ABestow::resolve() int ABestow::resolve()
{ {
if (target) if (target)
{ {
if (_card->hasType("creature")) if (_card->hasType("creature"))
{ {
_card->removeType("creature"); _card->removeType("creature");
_card->addType("aura"); _card->addType("aura");
} }
_card->target = (MTGCardInstance*)target; _card->target = (MTGCardInstance*)target;
_card->isBestowed = true; _card->isBestowed = true;
} }
return 1; return 1;
} }
const string ABestow::getMenuText() const string ABestow::getMenuText()
+6 -3
View File
@@ -32,7 +32,8 @@ void GameObserver::cleanup()
SAFE_DELETE(replacementEffects); SAFE_DELETE(replacementEffects);
for (size_t i = 0; i < players.size(); ++i) for (size_t i = 0; i < players.size(); ++i)
{ {
SAFE_DELETE(players[i]); if(players[i])
SAFE_DELETE(players[i]);
} }
players.clear(); players.clear();
@@ -60,7 +61,8 @@ GameObserver::~GameObserver()
for (size_t i = 0; i < players.size(); ++i) for (size_t i = 0; i < players.size(); ++i)
{ {
players[i]->End(); if(players[i])
players[i]->End();
} }
SAFE_DELETE(targetChooser); SAFE_DELETE(targetChooser);
SAFE_DELETE(mLayers); SAFE_DELETE(mLayers);
@@ -68,7 +70,8 @@ GameObserver::~GameObserver()
SAFE_DELETE(replacementEffects); SAFE_DELETE(replacementEffects);
for (size_t i = 0; i < players.size(); ++i) for (size_t i = 0; i < players.size(); ++i)
{ {
SAFE_DELETE(players[i]); if(players[i])
SAFE_DELETE(players[i]);
} }
players.clear(); players.clear();
delete[] ExtraRules; delete[] ExtraRules;