- fix bug eventBlocker
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-08-23 10:48:06 +00:00
parent 846f3b2ffc
commit a2149131fb
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -521,13 +521,16 @@ int MTGCardInstance::setDefenser(MTGCardInstance * opponent){
defenser->blockers.remove(this);
}
}
WEvent * e = NEW WEventCreatureBlocker(this, defenser, opponent);
WEvent * e = NULL;
if (defenser != opponent){
e = NEW WEventCreatureBlocker(this, defenser, opponent);
}
defenser = opponent;
if (defenser){
defenser->blockers.push_back(this);
}
g->blockersSorted = false;
g->receiveEvent(e);
if (e) g->receiveEvent(e);
//delete e;
return 1;
}
+1 -1
View File
@@ -18,7 +18,7 @@ WEventCardTap::WEventCardTap(MTGCardInstance * card, bool before, bool after) :
WEventCreatureAttacker::WEventCreatureAttacker(MTGCardInstance * card, Targetable * before, Targetable * after) : WEventCardUpdate(card), before(before), after(after){}
WEventCreatureBlocker::WEventCreatureBlocker(MTGCardInstance * card, MTGCardInstance * from,MTGCardInstance * to) : WEventCardUpdate(card), before(before), after(after){}
WEventCreatureBlocker::WEventCreatureBlocker(MTGCardInstance * card, MTGCardInstance * from,MTGCardInstance * to) : WEventCardUpdate(card), before(from), after(to){}
WEventCreatureBlockerRank::WEventCreatureBlockerRank(MTGCardInstance * card, MTGCardInstance * exchangeWith, MTGCardInstance * attacker) : WEventCardUpdate(card), exchangeWith(exchangeWith), attacker(attacker){}