summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-30 22:51:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-30 22:51:23 +0300
commitef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2 (patch)
treec3d7c79fca18ac387d0c90512ef3201c92da5890 /src/resources
parent22b64d16b613c1e5b26632237879b167024788ab (diff)
downloadmanaverse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.gz
manaverse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.bz2
manaverse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.tar.xz
manaverse-ef8ef35d28daa3ea7dd542078ac9c0d3f7a9a5e2.zip
Move some variables to better scope.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/db/itemdb.cpp7
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