From ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 30 Aug 2017 22:51:23 +0300 Subject: Move some variables to better scope. --- src/resources/db/itemdb.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/resources/db') 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::const_iterator it = mSoundNames.find(event); if (it != mSoundNames.end()) { + const std::string filename = XmlChildContent(node); itemInfo->addSound((*it).second, filename, delay); } else -- cgit v1.2.3-60-g2f50