diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-01-24 22:10:02 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-01-24 22:10:02 +0100 |
commit | d055bee5e6b45737ab89b3f8c70c6d0db7a22eb3 (patch) | |
tree | 081556c8fa27ce16372b1657e469ccd8587dd4e5 /src/localplayer.cpp | |
parent | f663f5bbb75b850ae22f451a22d112b6c62b2ad6 (diff) | |
download | mana-d055bee5e6b45737ab89b3f8c70c6d0db7a22eb3.tar.gz mana-d055bee5e6b45737ab89b3f8c70c6d0db7a22eb3.tar.bz2 mana-d055bee5e6b45737ab89b3f8c70c6d0db7a22eb3.tar.xz mana-d055bee5e6b45737ab89b3f8c70c6d0db7a22eb3.zip |
Refactored the item loading in a more extensible and per protocol way.
This will greatly help into upgrading the need of
each protocol separately.
This is the first step to a new item and equipment system for manaserv.
A subclassing of the EquipmentWindow will be done in the next commit,
as requested by Thorbjorn.
Reviewed-by: Thorbjorn.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 7d427b82..81fb1cee 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -1020,12 +1020,16 @@ int LocalPlayer::getAttackRange() } else { - // TODO: Fix this to be more generic - Item *weapon = PlayerInfo::getEquipment(EQUIP_FIGHT1_SLOT); - if (weapon) + if (Net::getNetworkType() == ServerInfo::TMWATHENA) { - const ItemInfo info = weapon->getInfo(); - return info.getAttackRange(); + // TODO: Fix this to be more generic + Item *weapon = PlayerInfo::getEquipment( + TmwAthena::EQUIP_FIGHT1_SLOT); + if (weapon) + { + const ItemInfo info = weapon->getInfo(); + return info.getAttackRange(); + } } return 48; // unarmed range } |