summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-10-27 05:20:45 +0000
committerIra Rice <irarice@gmail.com>2008-10-27 05:20:45 +0000
commitd303b0164b62708b48b9f831ff0e37bddd8eb5e9 (patch)
tree88b6684bc8ad76c41a9d879e1712ad1624399032
parent218ad29dc13b1b89da9804dec15f32692d8709d6 (diff)
downloadmana-d303b0164b62708b48b9f831ff0e37bddd8eb5e9.tar.gz
mana-d303b0164b62708b48b9f831ff0e37bddd8eb5e9.tar.bz2
mana-d303b0164b62708b48b9f831ff0e37bddd8eb5e9.tar.xz
mana-d303b0164b62708b48b9f831ff0e37bddd8eb5e9.zip
Added the ability to turn off a target by targeting it again after being
targeted.
-rw-r--r--src/localplayer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 440ea636..a16aa685 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -273,12 +273,18 @@ void LocalPlayer::setTarget(Being *target)
if (mLastAction != -1)
return;
mLastAction = tick_time;
+ mTargetTime = tick_time;
if (target == mTarget)
{
- if (target != NULL)
+ if (mTarget)
{
- target->mTargetCursor = NULL;
+ if (mTarget->getType() == Being::MONSTER)
+ {
+ static_cast<Monster *>(mTarget)->showName(false);
+ }
+ mTarget->mTargetCursor = NULL;
+ mTarget = NULL;
}
return;
}
@@ -580,6 +586,7 @@ void LocalPlayer::loadTargetCursor(std::string filename, int width, int height,
void LocalPlayer::drawTargetCursor(Graphics *graphics, int scrollX, int scrollY)
{
+
// Draw target marker if needed
if (mTarget)
{