summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-14 03:54:55 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-14 23:52:45 +0200
commit3805d1384894a33ecb09e4852d47afb04ddb0687 (patch)
tree840b5920d912576554e0e11e67794a726d4a9c4f /src/resources/iteminfo.cpp
parent36ccecd553539955929f1ce535b8925533922e4e (diff)
downloadmv-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.gz
mv-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.bz2
mv-3805d1384894a33ecb09e4852d47afb04ddb0687.tar.xz
mv-3805d1384894a33ecb09e4852d47afb04ddb0687.zip
Replace sprites functionality (need support in client data).
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index f65e0396a..c2d3aafef 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -25,6 +25,7 @@
#include "configuration.h"
#include <set>
+#include <map>
const std::string &ItemInfo::getSprite(Gender gender) const
{
@@ -67,13 +68,15 @@ const std::string &ItemInfo::getSound(EquipmentSoundEvent event) const
return i == mSounds.end() ? empty : i->second[rand() % i->second.size()];
}
-bool ItemInfo::isRemoveSpriteId(int id) const
+std::map<int,int> &ItemInfo::addReplaceSprite(int sprite)
{
- if (!mRemoveSpriteIds.size()
- || mRemoveSpriteIds.find(id) != mRemoveSpriteIds.end())
+ std::map<int, std::map<int, int> >::iterator it
+ = mSpriteToItemReplaceMap.find(sprite);
+ if (it == mSpriteToItemReplaceMap.end())
{
- return true;
+ std::map<int, int> tmp;
+ mSpriteToItemReplaceMap[sprite] = tmp;
+ it = mSpriteToItemReplaceMap.find(sprite);
}
-
- return false;
-} \ No newline at end of file
+ return it->second;
+}