summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-27 23:50:16 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-27 23:50:16 +0000
commit30063f42cc8d13ed241a52b90e63c2c68599115e (patch)
tree68868a0aa04007a0ad4a62d97556c27b48f057d7 /src/engine.cpp
parent0ecae988adfa88cb6b8803a9f5b7215221fceb74 (diff)
downloadmana-client-30063f42cc8d13ed241a52b90e63c2c68599115e.tar.gz
mana-client-30063f42cc8d13ed241a52b90e63c2c68599115e.tar.bz2
mana-client-30063f42cc8d13ed241a52b90e63c2c68599115e.tar.xz
mana-client-30063f42cc8d13ed241a52b90e63c2c68599115e.zip
autoTarget is now a Being*, also may have fixed related crash and added label
to show current target.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 938068b7..75d4ba2f 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -267,7 +267,11 @@ void Engine::logic()
being->logic();
- if (being->action == MONSTER_DEAD && being->frame >= 20) {
+ if (being->action == MONSTER_DEAD && being->frame >= 20)
+ {
+ if (autoTarget == being) {
+ autoTarget = NULL;
+ }
delete being;
beingIterator = beings.erase(beingIterator);
}
@@ -400,8 +404,10 @@ void Engine::draw()
if (being->action == MONSTER_DEAD) {
monsterset[being->job - 1002]->spriteset[dir + 4 * MONSTER_DEAD]->draw(screen,
being->text_x + 30, being->text_y + 40);
- if (autoTarget == being->id)
- autoTarget = 0;
+
+ if (autoTarget == being) {
+ autoTarget = NULL;
+ }
}
else {
monsterset[being->job-1002]->spriteset[dir + 4 * mf]->draw(