summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorRoderic Morris <roderic@ccs.neu.edu>2008-10-25 01:40:36 +0000
committerRoderic Morris <roderic@ccs.neu.edu>2008-10-25 01:40:36 +0000
commit796c2addfb17b57992d304667248873ee26088dc (patch)
tree8d3aaab2dd6abbc304eb9f8b70551b210894a7e2 /src/localplayer.cpp
parentf8f3e17f72d1216bacd5aaa975789b0b790068f6 (diff)
downloadmana-796c2addfb17b57992d304667248873ee26088dc.tar.gz
mana-796c2addfb17b57992d304667248873ee26088dc.tar.bz2
mana-796c2addfb17b57992d304667248873ee26088dc.tar.xz
mana-796c2addfb17b57992d304667248873ee26088dc.zip
attack range fixes, highlight monsters in range (by Chuck Miller)
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 77fd5b90..68648d74 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -52,7 +52,6 @@ LocalPlayer *player_node = NULL;
LocalPlayer::LocalPlayer():
Player(65535, 0, NULL),
- mAttackRange(0),
mInventory(new Inventory),
mEquipment(new Equipment),
mAttributeBase(NB_CHARACTER_ATTRIBUTES, -1),
@@ -510,3 +509,16 @@ std::pair<int, int> LocalPlayer::getExperience(int skill)
{
return std::pair<int, int> (mExpCurrent.at(skill), mExpNext.at(skill));
}
+
+int LocalPlayer::getAttackRange()
+{
+ Item *weapon = mEquipment->getEquipment(EQUIP_FIGHT1_SLOT);
+ if(weapon)
+ {
+ const ItemInfo info = weapon->getInfo();
+ return info.getAttackRange();
+ }
+ return 32; //unarmed range
+
+}
+