diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/itemdb.cpp | 4 | ||||
-rw-r--r-- | src/resources/iteminfo.cpp | 2 | ||||
-rw-r--r-- | src/resources/iteminfo.h | 2 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 3 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index d6be7eae0..418bfb848 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -560,7 +560,9 @@ void loadFloorSprite(SpriteDisplay *display, xmlNodePtr floorNode) void loadReplaceSprite(ItemInfo *itemInfo, xmlNodePtr replaceNode) { std::string removeSprite = XML::getProperty(replaceNode, "sprite", ""); - std::map<int,int> &mapList = itemInfo->addReplaceSprite(parseSpriteName(removeSprite)); + std::map<int, int> &mapList = itemInfo->addReplaceSprite( + parseSpriteName(removeSprite)); + itemInfo->setRemoveSprites(); for_each_xml_child_node(itemNode, replaceNode) diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 02c3c4d45..255a9a7b3 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -69,7 +69,7 @@ const std::string &ItemInfo::getSound(EquipmentSoundEvent event) const return i == mSounds.end() ? empty : i->second[rand() % i->second.size()]; } -std::map<int,int> &ItemInfo::addReplaceSprite(int sprite) +std::map<int, int> &ItemInfo::addReplaceSprite(int sprite) { std::map<int, std::map<int, int> >::iterator it = mSpriteToItemReplaceMap.find(sprite); diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 05adb9215..5ea537fae 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -226,7 +226,7 @@ class ItemInfo int getReplaceToSpriteId(int id) const; - std::map<int,int> &addReplaceSprite(int sprite); + std::map<int, int> &addReplaceSprite(int sprite); std::map<int, std::map<int, int> > getSpriteToItemReplaceMap() const { return mSpriteToItemReplaceMap; } diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 808615ae9..5a635a8c2 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -457,7 +457,10 @@ void MapReader::readLayer(xmlNodePtr node, Map *map) unsigned char *charData = new unsigned char[len + 1]; const char *charStart = (const char*) xmlNodeGetContent(dataChild); if (!charStart) + { + delete charData; return; + } unsigned char *charIndex = charData; |