diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-05-21 21:56:41 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-05-21 21:56:41 +0200 |
commit | 63b4c9869b6256ed7644113cd23305b07cf9df03 (patch) | |
tree | aff0d99f5b58cbaf4195ac755ecfb79f97bf7b65 /src/localplayer.cpp | |
parent | 8c4c5a58c256cce7beb21b68c8a7d6b6ff5c4a3a (diff) | |
parent | 2953a3f92c5097bd99ff21f4536fe167a32d90c5 (diff) | |
download | mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.gz mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.bz2 mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.tar.xz mana-client-63b4c9869b6256ed7644113cd23305b07cf9df03.zip |
Merge branch '1.0'
Conflicts:
src/beingmanager.cpp
src/beingmanager.h
src/client.cpp
src/localplayer.cpp
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 17384a1f..40592f59 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -121,6 +121,9 @@ LocalPlayer::~LocalPlayer() delete mInventory; config.removeListener("showownname", this); + + delete mAwayDialog; + delete mAwayListener; } void LocalPlayer::logic() @@ -1275,13 +1278,11 @@ bool LocalPlayer::withinAttackRange(Being *target) } else { - int dist_x = abs(target->getTileX() - getTileY()); - int dist_y = abs(target->getTileY() - getTileX()); + int dist_x = abs(target->getTileX() - getTileX()); + int dist_y = abs(target->getTileY() - getTileY()); if (dist_x > getAttackRange() || dist_y > getAttackRange()) - { return false; - } return true; } @@ -1377,10 +1378,8 @@ void LocalPlayer::changeAwayMode() config.getValue("afkMessage", "I am away from keyboard")); mAwayDialog->addActionListener(mAwayListener); } - else - { - mAwayDialog = 0; - } + + mAwayDialog = 0; } void LocalPlayer::setAway(const std::string &message) |