From 91ee1c7b3e861d84c8aae51ad933ff6015adb5b8 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 16 Feb 2009 23:57:21 +0100 Subject: Don't arbitrarily unset player target on NPC deletion When an NPC got deleted it would reset the player target. I'm assuming what was meant was to reset the target when the deleted NPC was the target. --- src/localplayer.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/localplayer.h') diff --git a/src/localplayer.h b/src/localplayer.h index 4d0a05be..5f02de4f 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -141,8 +141,6 @@ class LocalPlayer : public Player void stopAttack(); - Being* getTarget() const; - /** * Overridden to do nothing. The attacks of the local player are * displayed as soon as the player attacks, not when the server says @@ -153,6 +151,12 @@ class LocalPlayer : public Player */ virtual void handleAttack(Being *victim, int damage) {} + /** + * Returns the current target of the player. Returns 0 if no being is + * currently targeted. + */ + Being* getTarget() const; + /** * Sets the target being of the player. */ -- cgit v1.2.3-60-g2f50