diff options
author | Roderic Morris <roderic@ccs.neu.edu> | 2008-10-25 01:40:36 +0000 |
---|---|---|
committer | Roderic Morris <roderic@ccs.neu.edu> | 2008-10-25 01:40:36 +0000 |
commit | 796c2addfb17b57992d304667248873ee26088dc (patch) | |
tree | 8d3aaab2dd6abbc304eb9f8b70551b210894a7e2 /src/localplayer.cpp | |
parent | f8f3e17f72d1216bacd5aaa975789b0b790068f6 (diff) | |
download | mana-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.cpp | 14 |
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 + +} + |