summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-20 20:15:34 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-20 20:17:07 +0200
commita1dbbdf1ca8560de8cff703d21c0063610261196 (patch)
treed986d59890ed32429e6413ab8eafcd7812b1d022 /src
parent46137db9170963393f003e6ae275f200942a83d8 (diff)
downloadmana-a1dbbdf1ca8560de8cff703d21c0063610261196.tar.gz
mana-a1dbbdf1ca8560de8cff703d21c0063610261196.tar.bz2
mana-a1dbbdf1ca8560de8cff703d21c0063610261196.tar.xz
mana-a1dbbdf1ca8560de8cff703d21c0063610261196.zip
Drop current target on death
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/browserbox.h2
-rw-r--r--src/localplayer.cpp11
-rw-r--r--src/localplayer.h3
3 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index 42af5b11..c5ca351d 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -126,7 +126,7 @@ class BrowserBox : public gcn::Widget, public gcn::MouseListener
PINK = 0xff00d8, /**< Color 6 */
PURPLE = 0x8415e2, /**< Color 7 */
GRAY = 0x919191, /**< Color 8 */
- BROWN = 0x8e4c17, /**< Color 9 */
+ BROWN = 0x8e4c17 /**< Color 9 */
};
/**
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 238af129..765c9bd2 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -225,6 +225,17 @@ void LocalPlayer::logic()
Player::logic();
}
+void LocalPlayer::setAction(Action action, int attackType)
+{
+ if (action == DEAD)
+ {
+ mLastTarget = -1;
+ setTarget(NULL);
+ }
+
+ Player::setAction(action, attackType);
+}
+
void LocalPlayer::setGM()
{
mIsGM = !mIsGM;
diff --git a/src/localplayer.h b/src/localplayer.h
index b7d39a4c..55e4e6f6 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -154,6 +154,8 @@ class LocalPlayer : public Player
virtual void logic();
+ virtual void setAction(Action action, int attackType = 0);
+
/**
* Adds a new step when walking before calling super. Also, when
* specified it picks up an item at the end of a path.
@@ -286,7 +288,6 @@ class LocalPlayer : public Player
*/
Being* getTarget() const;
-
/**
* Sets the target being of the player.
*/