diff options
author | Stefan Dombrowski <stefan@uni-bonn.de> | 2011-04-29 11:16:21 +0200 |
---|---|---|
committer | Stefan Dombrowski <stefan@uni-bonn.de> | 2011-04-29 11:16:21 +0200 |
commit | 18ea964add44d3d0211785c59b28e7afdc5e45fb (patch) | |
tree | f65677e61a3b773db549a347fa6c9e8ccf1a3cd6 /src/resources | |
parent | f450d1e7d0238a8126f2fe419aa019767290f9fb (diff) | |
download | mana-18ea964add44d3d0211785c59b28e7afdc5e45fb.tar.gz mana-18ea964add44d3d0211785c59b28e7afdc5e45fb.tar.bz2 mana-18ea964add44d3d0211785c59b28e7afdc5e45fb.tar.xz mana-18ea964add44d3d0211785c59b28e7afdc5e45fb.zip |
Remove default assignment of an attack action to non-weapons
This avoids log warnings for missing weapon range.
Reviewed-by: thorbjorn, bcs86
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/itemdb.cpp | 5 | ||||
-rw-r--r-- | src/resources/iteminfo.cpp | 8 | ||||
-rw-r--r-- | src/resources/iteminfo.h | 2 |
3 files changed, 3 insertions, 12 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index bb8e3bce..5e1b2a2f 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -196,7 +196,8 @@ void ItemDB::loadCommonRef(ItemInfo *itemInfo, xmlNodePtr node) std::string name = XML::getProperty(node, "name", ""); std::string image = XML::getProperty(node, "image", ""); std::string description = XML::getProperty(node, "description", ""); - std::string attackAction = XML::getProperty(node, "attack-action", ""); + std::string attackAction = XML::getProperty(node, "attack-action", + SpriteAction::INVALID); int attackRange = XML::getProperty(node, "attack-range", 0); std::string missileParticle = XML::getProperty(node, "missile-particle", ""); @@ -215,7 +216,7 @@ void ItemDB::loadCommonRef(ItemInfo *itemInfo, xmlNodePtr node) itemInfo->mDescription = description; itemInfo->mView = view; itemInfo->mWeight = weight; - itemInfo->setAttackAction(attackAction); + itemInfo->mAttackAction = attackAction; itemInfo->mAttackRange = attackRange; itemInfo->setMissileParticle(missileParticle); diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 32331e35..ad4b311c 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -41,14 +41,6 @@ const std::string &ItemInfo::getSprite(Gender gender) const } } -void ItemInfo::setAttackAction(std::string attackAction) -{ - 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.getStringValue("sfx") + filename); diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 76a74111..16bc4392 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -108,8 +108,6 @@ class ItemInfo const std::string &getSprite(Gender gender) const; - void setAttackAction(std::string attackAction); - // Handlers for seting and getting the string used for particles when attacking void setMissileParticle(std::string s) { mMissileParticle = s; } |