Erwan
- fix for issue 113
This commit is contained in:
@@ -266,18 +266,18 @@ int GuiPlay::receiveEventMinus(WEvent * e)
|
|||||||
{
|
{
|
||||||
if ((game->players[0]->inPlay() == event->from) ||
|
if ((game->players[0]->inPlay() == event->from) ||
|
||||||
(game->players[1]->inPlay() == event->from))
|
(game->players[1]->inPlay() == event->from))
|
||||||
for (iterator it = cards.begin(); it != cards.end(); ++it)
|
for (iterator it = cards.begin(); it != cards.end(); ++it)
|
||||||
if (event->card->previous == (*it)->card || event->card == (*it)->card )
|
if (event->card->previous == (*it)->card || event->card == (*it)->card )
|
||||||
{
|
{
|
||||||
if (event->card->previous && event->card->previous->attacker) battleField.removeAttacker(event->card->previous);
|
if (event->card->previous && event->card->previous->attacker) battleField.removeAttacker(event->card->previous);
|
||||||
else if (event->card->attacker) battleField.removeAttacker(event->card);
|
else if (event->card->attacker) battleField.removeAttacker(event->card);
|
||||||
CardView* cv = *it;
|
CardView* cv = *it;
|
||||||
cs->Remove(cv);
|
cs->Remove(cv);
|
||||||
cards.erase(it);
|
cards.erase(it);
|
||||||
trash(cv);
|
trash(cv);
|
||||||
Replace();
|
Replace();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,10 +155,20 @@ bool GuiGameZone::CheckUserInput(u32 key){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GuiGameZone::Update(float dt){
|
void GuiGameZone::Update(float dt){
|
||||||
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
|
|
||||||
(*it)->Update(dt);
|
|
||||||
if (showCards) cd->Update(dt);
|
if (showCards) cd->Update(dt);
|
||||||
PlayGuiObject::Update(dt);
|
PlayGuiObject::Update(dt);
|
||||||
|
|
||||||
|
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it){
|
||||||
|
CardView * c = (*it);
|
||||||
|
c->Update(dt);
|
||||||
|
|
||||||
|
//Dirty fix for http://code.google.com/p/wagic/issues/detail?id=113
|
||||||
|
if (fabs(c->actX - c->x) < 0.01 && fabs(c->actY - c->y)< 0.01){
|
||||||
|
cards.erase(it);
|
||||||
|
trash(c);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiGameZone::GuiGameZone(float x, float y, bool hasFocus, MTGGameZone* zone, GuiAvatars* parent): GuiStatic(GuiGameZone::Height, x, y, hasFocus, parent), zone(zone){
|
GuiGameZone::GuiGameZone(float x, float y, bool hasFocus, MTGGameZone* zone, GuiAvatars* parent): GuiStatic(GuiGameZone::Height, x, y, hasFocus, parent), zone(zone){
|
||||||
|
|||||||
Reference in New Issue
Block a user