diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 87832eb4f..6b3d1dc7b 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -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; } diff --git a/projects/mtg/src/WEvent.cpp b/projects/mtg/src/WEvent.cpp index 27844179e..8b669ffbe 100644 --- a/projects/mtg/src/WEvent.cpp +++ b/projects/mtg/src/WEvent.cpp @@ -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){}