summaryrefslogtreecommitdiffstats
path: root/pacman-c++/sceneholder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/sceneholder.cpp')
-rw-r--r--pacman-c++/sceneholder.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/pacman-c++/sceneholder.cpp b/pacman-c++/sceneholder.cpp
index e4429f6..c819b95 100644
--- a/pacman-c++/sceneholder.cpp
+++ b/pacman-c++/sceneholder.cpp
@@ -40,8 +40,16 @@ void SceneHolder::updateMap(const Transmission::map_t& map)
40 { 40 {
41 m_scene->removeItem(oldItem); 41 m_scene->removeItem(oldItem);
42 visualMap[x][y] = NULL; 42 visualMap[x][y] = NULL;
43 Actor *actor = NULL;
44 foreach (Actor *i, m_actors) {
45 if (CoordToMapPosition(i->pos().x(), i->pos().y()) == QPoint(x, y)) {
46 actor = i;
47 break;
48 }
49 }
50 oldItem->onDie(actor);
43 delete oldItem; 51 delete oldItem;
44 qDebug() << "deleting " << x << y; 52 //qDebug() << "deleting " << x << y;
45 } 53 }
46 } 54 }
47 55
@@ -104,7 +112,6 @@ void SceneHolder::updateMap(const Transmission::map_t& map)
104 visualMap[x][y] = item; 112 visualMap[x][y] = item;
105 if (oldItem != NULL) 113 if (oldItem != NULL)
106 { 114 {
107 oldItem->onDie();
108 m_scene->removeItem(item); 115 m_scene->removeItem(item);
109 delete oldItem; 116 delete oldItem;
110 } 117 }