diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-28 13:25:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-29 00:49:52 +0300 |
commit | 46696c84bad31e35e003b5c09998503119b128eb (patch) | |
tree | 7449b98a62fa7ff520d995b27511878d2605c7d4 /src/resources/itemdb.cpp | |
parent | c79403e1341ac533df1771b866d1f5cee15e12b5 (diff) | |
download | ManaVerse-46696c84bad31e35e003b5c09998503119b128eb.tar.gz ManaVerse-46696c84bad31e35e003b5c09998503119b128eb.tar.bz2 ManaVerse-46696c84bad31e35e003b5c09998503119b128eb.tar.xz ManaVerse-46696c84bad31e35e003b5c09998503119b128eb.zip |
Add to replace/reorder sprites pseudo direction "died"
It allow change sprites in dead players.
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r-- | src/resources/itemdb.cpp | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 1ae7c2c59..03894d8bc 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -366,6 +366,43 @@ void ItemDB::load() } } +/* + logger->log("start dump item: %d", id); + if (itemInfo->isRemoveSprites()) + { + for (int f = 0; f < 10; f ++) + { + logger->log("dir: %d", f); + SpriteToItemMap *const spriteToItems + = itemInfo->getSpriteToItemReplaceMap(f); + if (!spriteToItems) + { + logger->log("null"); + continue; + } + for (SpriteToItemMapCIter itr = spriteToItems->begin(), + itr_end = spriteToItems->end(); itr != itr_end; ++ itr) + { + const int remSprite = itr->first; + const std::map<int, int> &itemReplacer = itr->second; + logger->log("sprite: %d", remSprite); + + for (std::map<int, int>::const_iterator + repIt = itemReplacer.begin(), + repIt_end = itemReplacer.end(); + repIt != repIt_end; ++ repIt) + { + logger->log("from %d to %d", repIt->first, + repIt->second); + } + } + } + } + + logger->log("--------------------------------"); + logger->log("end dump item"); +*/ + itemInfo->setDisplay(display); mItemInfos[id] = itemInfo; @@ -601,6 +638,11 @@ int parseDirectionName(std::string name) { id = -3; } + // hack for died action. + else if (name == "died") + { + id = 9; + } return id; } @@ -675,7 +717,7 @@ void loadReplaceSprite(ItemInfo *itemInfo, XmlNodePtr replaceNode) { case -1: { - for (int f = 0; f < 9; f ++) + for (int f = 0; f < 10; f ++) { std::map<int, int> *mapList = itemInfo->addReplaceSprite( |