summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 9c275f96..1cd3c546 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -41,30 +41,12 @@ const std::string &ItemInfo::getSprite(Gender gender) const
}
}
-void ItemInfo::setWeaponType(int type)
+void ItemInfo::setAttackAction(std::string attackAction)
{
- // See server item.hpp file for type values.
- switch (type)
- {
- case WPNTYPE_NONE:
- mWeaponAttackType = ACTION_DEFAULT;
- break;
- case WPNTYPE_KNIFE:
- case WPNTYPE_SWORD:
- mWeaponAttackType = ACTION_ATTACK_STAB;
- break;
- case WPNTYPE_THROWN:
- mWeaponAttackType = ACTION_ATTACK_THROW;
- break;
- case WPNTYPE_BOW:
- mWeaponAttackType = ACTION_ATTACK_BOW;
- break;
- case WPNTYPE_POLEARM:
- mWeaponAttackType = ACTION_ATTACK_SWING;
- break;
- default:
- mWeaponAttackType = ACTION_ATTACK;
- }
+ if (attackAction.empty())
+ mAttackAction = SpriteAction::ATTACK; // (Equal to unarmed animation)
+ else
+ mAttackAction = attackAction;
}
void ItemInfo::addSound(EquipmentSoundEvent event, const std::string &filename)