summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-20 10:50:00 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-11-20 10:50:00 +0000
commit5a7abdafdac8f6ddd7972cadbc7e20563a0a29fc (patch)
tree95684590a32266b28f046475cfa1926c99f67e52 /src/resources/iteminfo.cpp
parentcf36850d2bdda67cb472d938ed58053a92fa6935 (diff)
downloadmana-5a7abdafdac8f6ddd7972cadbc7e20563a0a29fc.tar.gz
mana-5a7abdafdac8f6ddd7972cadbc7e20563a0a29fc.tar.bz2
mana-5a7abdafdac8f6ddd7972cadbc7e20563a0a29fc.tar.xz
mana-5a7abdafdac8f6ddd7972cadbc7e20563a0a29fc.zip
Merged revisions 3629-3630 via svnmerge from
https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/trunk (but kept looks in Being class, since eAthena works that way) ........ r3629 | gmelquio | 2007-10-18 21:00:38 +0200 (Thu, 18 Oct 2007) | 1 line Removed player looks from generic beings. Prevented client termination on missing sprites. Merged weapon-type and attack-type fields for items. ........ r3630 | gmelquio | 2007-10-18 21:30:57 +0200 (Thu, 18 Oct 2007) | 1 line Fixed changelog message. ........
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 3b32ec71..82c46e3c 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -71,32 +71,29 @@ ItemInfo::getSprite(int gender) const
}
}
-void
-ItemInfo::setAttackType(const std::string &attackType)
+void ItemInfo::setWeaponType(int type)
{
- if (attackType == "swing")
- {
- mAttackType = ACTION_ATTACK_SWING;
- }
- else if (attackType == "stab")
- {
- mAttackType = ACTION_ATTACK_STAB;
- }
- else if (attackType == "bow")
- {
- mAttackType = ACTION_ATTACK_BOW;
- }
- else if (attackType == "throw")
- {
- mAttackType = ACTION_ATTACK_THROW;
- }
- else if (attackType == "none")
- {
- mAttackType = ACTION_DEFAULT;
- }
- else
+ // See server item.hpp file for type values.
+ switch (type)
{
- mAttackType = ACTION_ATTACK;
+ case 0: // none
+ mAttackType = ACTION_DEFAULT;
+ break;
+ case 1: // knife
+ case 2: // sword
+ mAttackType = ACTION_ATTACK_STAB;
+ break;
+ case 8: // projectile
+ mAttackType = ACTION_ATTACK_THROW;
+ break;
+ case 10: // bow
+ mAttackType = ACTION_ATTACK_BOW;
+ break;
+ case 11: // sickle
+ mAttackType = ACTION_ATTACK_SWING;
+ break;
+ default:
+ mAttackType = ACTION_ATTACK;
}
}