diff options
Diffstat (limited to 'src/resources/db/itemdb.cpp')
-rw-r--r-- | src/resources/db/itemdb.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index a1395142a..08055e404 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -991,16 +991,19 @@ static void loadSpriteRef(ItemInfo *const itemInfo, XmlNodeConstPtr node) static void loadSoundRef(ItemInfo *const itemInfo, XmlNodeConstPtr node) { - if ((node == nullptr) || !XmlHaveChildContent(node)) + if (node == nullptr || + !XmlHaveChildContent(node)) + { return; + } const std::string event = XML::getProperty(node, "event", ""); - const std::string filename = XmlChildContent(node); const int delay = XML::getProperty(node, "delay", 0); const std::map<std::string, ItemSoundEvent::Type>::const_iterator it = mSoundNames.find(event); if (it != mSoundNames.end()) { + const std::string filename = XmlChildContent(node); itemInfo->addSound((*it).second, filename, delay); } else |