From fb0626ebec688dfd1b4fe4d8c324c2f7b34fada2 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 16 Feb 2009 18:26:35 -0700 Subject: Moved target unsetting on NPCs and monsters to the being class. This is done to ensure that the client doesn't crash if the target dies and is removed from the map (since target drawing is based off of the specific target reporting its x and y coordinates). Signed-off-by: Ira Rice --- src/being.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 8e07514f..c944bcf9 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -29,6 +29,7 @@ #include "effectmanager.h" #include "game.h" #include "graphics.h" +#include "localplayer.h" #include "log.h" #include "map.h" #include "particle.h" @@ -128,6 +129,9 @@ Being::~Being() delete_all(mSprites); clearPath(); + if (player_node->getTarget() == this) + player_node->setTarget(NULL); + setMap(NULL); instances--; -- cgit v1.2.3-70-g09d2