From f89de74b1ac1cd9a02a70dab9221d601296da8cd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 2 Nov 2015 17:23:32 +0300 Subject: Add intmap defines. --- src/resources/db/itemdb.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/resources/db/itemdb.cpp') diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index da3444c0e..9de6b307e 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -589,11 +589,10 @@ void ItemDB::loadXmlFile(const std::string &fileName, int &tagNum) itr_end = spriteToItems->end(); itr != itr_end; ++ itr) { const int remSprite = itr->first; - const std::map &itemReplacer = itr->second; + const IntMap &itemReplacer = itr->second; logger->log("sprite: %d", remSprite); - for (std::map::const_iterator - repIt = itemReplacer.begin(), + for (IntMapCIter repIt = itemReplacer.begin(), repIt_end = itemReplacer.end(); repIt != repIt_end; ++ repIt) { @@ -934,8 +933,7 @@ static void loadReplaceSprite(ItemInfo *const itemInfo, { // replace only given sprites for (int f = 0; f < 10; f ++) { - std::map *const mapList - = itemInfo->addReplaceSprite( + IntMap *const mapList = itemInfo->addReplaceSprite( parseSpriteName(removeSprite), f); if (!mapList) continue; @@ -969,7 +967,7 @@ static void loadReplaceSprite(ItemInfo *const itemInfo, { const int from = XML::getProperty(itemNode, "from", 0); const int to = XML::getProperty(itemNode, "to", 1); - std::map *mapList = itemInfo->addReplaceSprite( + IntMap *mapList = itemInfo->addReplaceSprite( parseSpriteName(removeSprite), SpriteDirection::DOWN); if (mapList) (*mapList)[from] = to; @@ -1002,7 +1000,7 @@ static void loadReplaceSprite(ItemInfo *const itemInfo, { const int from = XML::getProperty(itemNode, "from", 0); const int to = XML::getProperty(itemNode, "to", 1); - std::map *mapList = itemInfo->addReplaceSprite( + IntMap *mapList = itemInfo->addReplaceSprite( parseSpriteName(removeSprite), SpriteDirection::UP); if (mapList) (*mapList)[from] = to; @@ -1022,7 +1020,7 @@ static void loadReplaceSprite(ItemInfo *const itemInfo, } default: { - std::map *const mapList = itemInfo->addReplaceSprite( + IntMap *const mapList = itemInfo->addReplaceSprite( parseSpriteName(removeSprite), direction); if (!mapList) return; -- cgit v1.2.3-60-g2f50