diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-30 22:51:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-30 22:51:23 +0300 |
commit | ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2 (patch) | |
tree | c3d7c79fca18ac387d0c90512ef3201c92da5890 /src/resources/db | |
parent | 22b64d16b613c1e5b26632237879b167024788ab (diff) | |
download | mv-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.gz mv-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.bz2 mv-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.xz mv-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.zip |
Move some variables to better scope.
Diffstat (limited to 'src/resources/db')
-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 |