diff options
author | remoitnane <remoit(DOT)nane(AT)gmail(DOT)com> | 2010-07-07 03:59:33 -0700 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-08 22:33:31 +0200 |
commit | 27efdd9a80c7d068f27db8725c2315fee3e10303 (patch) | |
tree | 2699a54961f6c29249c9d48747b8938b2d99dbd1 /src/localplayer.h | |
parent | f1cab9c5ab1d36586ae1e0d1dae3f3d1483522b5 (diff) | |
download | mana-27efdd9a80c7d068f27db8725c2315fee3e10303.tar.gz mana-27efdd9a80c7d068f27db8725c2315fee3e10303.tar.bz2 mana-27efdd9a80c7d068f27db8725c2315fee3e10303.tar.xz mana-27efdd9a80c7d068f27db8725c2315fee3e10303.zip |
Fix crash in picking up an item that no longer exists
Adds ActorSpriteListener to manage ActorSprite destruction as
recommended by Jaxad0127. This likewise includes the changes made by
Bertram.
Reviewed-by: Jaxad0127, Bertram.
Resolves: Manasource Mantis #160
Diffstat (limited to 'src/localplayer.h')
-rw-r--r-- | src/localplayer.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/localplayer.h b/src/localplayer.h index a7ed33f8..403b4530 100644 --- a/src/localplayer.h +++ b/src/localplayer.h @@ -23,6 +23,7 @@ #define LOCALPLAYER_H #include "being.h" +#include "actorspritelistener.h" #include "gui/userpalette.h" @@ -109,7 +110,7 @@ enum /** * The local player character. */ -class LocalPlayer : public Being +class LocalPlayer : public Being, public ActorSpriteListener { public: /** @@ -164,6 +165,12 @@ class LocalPlayer : public Being void pickUp(FloorItem *item); /** + * Called when an ActorSprite has been destroyed. + * @param actorSprite the ActorSprite being destroyed. + */ + void actorSpriteDestroyed(const ActorSprite &actorSprite); + + /** * Sets the attack range. */ void setAttackRange(int range) { mAttackRange = range; } |