- Fix an android warning (false instead of null in GuiCombat)

- removed unnecessary "if" in some parts of MTGRules.cpp
This commit is contained in:
wagic.the.homebrew@gmail.com
2013-01-27 02:09:10 +00:00
parent f6e95af995
commit d8da70361a
2 changed files with 23 additions and 25 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ struct Right: public Exp
JTexture* GuiCombat::ok_tex = NULL; JTexture* GuiCombat::ok_tex = NULL;
GuiCombat::GuiCombat(GameObserver* go) : GuiCombat::GuiCombat(GameObserver* go) :
GuiLayer(go), active(0), activeAtk(NULL), ok(SCREEN_WIDTH - MARGIN, 210, 1, 0, 255), enemy_avatar(SCREEN_WIDTH GuiLayer(go), active(NULL), activeAtk(NULL), ok(SCREEN_WIDTH - MARGIN, 210, 1, 0, 255), enemy_avatar(SCREEN_WIDTH
- MARGIN, TOP_LINE, 2, 0, 255), cursor_pos(NONE), step(DAMAGE) - MARGIN, TOP_LINE, 2, 0, 255), cursor_pos(NONE), step(DAMAGE)
{ {
if (NULL == ok_tex && go->getResourceManager()) if (NULL == ok_tex && go->getResourceManager())
+4 -6
View File
@@ -62,15 +62,14 @@ int MTGEventBonus::receiveEvent(WEvent * event)
return 0; return 0;
if (WEventCardTappedForMana* e = dynamic_cast<WEventCardTappedForMana*>(event)) if (WEventCardTappedForMana* e = dynamic_cast<WEventCardTappedForMana*>(event))
{ {
if(e)
{
if(chain[currentPlayer->getId()]/5 > 0) if(chain[currentPlayer->getId()]/5 > 0)
{ {
text = "Chain Broken!"; text = "Chain Broken!";
textAlpha = 255; textAlpha = 255;
} }
chain[currentPlayer->getId()] = 0; chain[currentPlayer->getId()] = 0;
}
} }
if (event->type == WEvent::CHANGE_ZONE && !currentPlayer->isAI()) if (event->type == WEvent::CHANGE_ZONE && !currentPlayer->isAI())
{ {
@@ -1503,8 +1502,7 @@ int MTGBlockRule::receiveEvent(WEvent *e)
{ {
if (WEventBlockersChosen * event = dynamic_cast<WEventBlockersChosen*>(e)) if (WEventBlockersChosen * event = dynamic_cast<WEventBlockersChosen*>(e))
{ {
if (event)
{
Player * p = game->currentPlayer; Player * p = game->currentPlayer;
MTGCardInstance * lurer = p->game->inPlay->findALurer(); MTGCardInstance * lurer = p->game->inPlay->findALurer();
if(lurer) if(lurer)
@@ -1521,7 +1519,7 @@ int MTGBlockRule::receiveEvent(WEvent *e)
} }
} }
return 1; return 1;
}
} }
return 0; return 0;
} }