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.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index 4b1d82ea..1cd3c546 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -41,35 +41,17 @@ 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:
- mAttackType = ACTION_DEFAULT;
- break;
- case WPNTYPE_KNIFE:
- case WPNTYPE_SWORD:
- mAttackType = ACTION_ATTACK_STAB;
- break;
- case WPNTYPE_THROWN:
- mAttackType = ACTION_ATTACK_THROW;
- break;
- case WPNTYPE_BOW:
- mAttackType = ACTION_ATTACK_BOW;
- break;
- case WPNTYPE_POLEARM:
- mAttackType = ACTION_ATTACK_SWING;
- break;
- default:
- mAttackType = ACTION_ATTACK;
- }
+ if (attackAction.empty())
+ mAttackAction = SpriteAction::ATTACK; // (Equal to unarmed animation)
+ else
+ mAttackAction = attackAction;
}
void ItemInfo::addSound(EquipmentSoundEvent event, const std::string &filename)
{
- mSounds[event].push_back(paths.getValue("sfx", "sfx/") + filename);
+ mSounds[event].push_back(paths.getStringValue("sfx") + filename);
}
const std::string &ItemInfo::getSound(EquipmentSoundEvent event) const