From d439be4f75880c4a1bf1f0f2f04e4e9fac307f30 Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Tue, 25 Jan 2011 07:52:01 +0000 Subject: [PATCH] Fixed http://code.google.com/p/wagic/issues/detail?id=572, where a card sometimes might not show its tap status correctly. My fix for 550 was slightly off, in that if a card view's position was updated (ie from a zone change, etc), the pos pointer shouldn't be cleared. Only the pos related to the 'this' pointer is the one that can't be referenced anymore, fixed the destructor code. --- projects/mtg/src/CardGui.cpp | 2 +- projects/mtg/src/GuiPlay.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 86d328636..61d95e56f 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -89,7 +89,7 @@ CardView::~CardView() { if (card) { - const Pos* r = card->view; + const Pos* r = this; while (card) { if (r == card->view) diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 2a2f9da39..191a5f6ee 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -370,6 +370,11 @@ int GuiPlay::receiveEventPlus(WEvent * e) { event->card->view->actT = event->after ? M_PI / 2 : 0; } + else + { + // this should never happen, if you have a consistent repro case, ping Wil please + assert(false); + } return 1; } else if (WEventPhaseChange *event = dynamic_cast(e))