summaryrefslogtreecommitdiff
path: root/src/statuseffect.cpp
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2012-01-25 22:05:36 +0100
committerReid <reidyaro@gmail.com>2012-01-25 22:05:36 +0100
commit8b612abb42853a22c1a9545e2c9280d154646543 (patch)
treef466167087c2b2de4b8aa9e6d1d1986f72f84147 /src/statuseffect.cpp
parenta913dd41df61760de6ece552f941e002251ff54c (diff)
parentd340b5a27a8f3b05d1764da9c114f5f59bd0cd46 (diff)
downloadplus-8b612abb42853a22c1a9545e2c9280d154646543.tar.gz
plus-8b612abb42853a22c1a9545e2c9280d154646543.tar.bz2
plus-8b612abb42853a22c1a9545e2c9280d154646543.tar.xz
plus-8b612abb42853a22c1a9545e2c9280d154646543.zip
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/statuseffect.cpp')
-rw-r--r--src/statuseffect.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp
index f7bffc31f..a7e06a2f4 100644
--- a/src/statuseffect.cpp
+++ b/src/statuseffect.cpp
@@ -2,7 +2,7 @@
* The ManaPlus Client
* Copyright (C) 2008-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
- * Copyright (C) 2011 The ManaPlus Developers
+ * Copyright (C) 2011-2012 The ManaPlus Developers
*
* This file is part of The ManaPlus Client.
*
@@ -37,7 +37,7 @@
#define STATUS_EFFECTS_FILE "status-effects.xml"
-void unloadMap(std::map<int, StatusEffect *> map);
+void unloadMap(std::map<int, StatusEffect *> &map);
bool StatusEffect::mLoaded = false;
@@ -130,9 +130,9 @@ void StatusEffect::load()
unload();
XML::Document doc(STATUS_EFFECTS_FILE);
- xmlNodePtr rootNode = doc.rootNode();
+ XmlNodePtr rootNode = doc.rootNode();
- if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "status-effects"))
+ if (!rootNode || !xmlNameEqual(rootNode, "status-effects"))
{
logger->log1("Error loading status effects file: "
STATUS_EFFECTS_FILE);
@@ -145,7 +145,7 @@ void StatusEffect::load()
int index = atoi(XML::getProperty(node, "id", "-1").c_str());
- if (xmlStrEqual(node->name, BAD_CAST "status-effect"))
+ if (xmlNameEqual(node, "status-effect"))
{
the_map = &statusEffects;
int block_index = atoi(XML::getProperty(
@@ -155,8 +155,10 @@ void StatusEffect::load()
blockEffectIndexMap[block_index] = index;
}
- else if (xmlStrEqual(node->name, BAD_CAST "stun-effect"))
+ else if (xmlNameEqual(node, "stun-effect"))
+ {
the_map = &stunEffects;
+ }
if (the_map)
{
@@ -187,7 +189,7 @@ void StatusEffect::load()
mLoaded = true;
}
-void unloadMap(std::map<int, StatusEffect *> map)
+void unloadMap(std::map<int, StatusEffect *> &map)
{
std::map<int, StatusEffect *>::iterator it;