summaryrefslogtreecommitdiff
path: root/src/game-server/mapreader.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-12-15 18:15:04 -0700
committerJared Adams <jaxad0127@gmail.com>2010-12-15 18:15:04 -0700
commit5639bd86e3337d1e93c9b10b88a62dfe797ea163 (patch)
tree0467fd94434935c581dd41ab1ffcb7256e05072c /src/game-server/mapreader.cpp
parent8ee95f35f2ed9766954281091a34cc5ca5b6fef8 (diff)
downloadmanaserv-5639bd86e3337d1e93c9b10b88a62dfe797ea163.tar.gz
manaserv-5639bd86e3337d1e93c9b10b88a62dfe797ea163.tar.bz2
manaserv-5639bd86e3337d1e93c9b10b88a62dfe797ea163.tar.xz
manaserv-5639bd86e3337d1e93c9b10b88a62dfe797ea163.zip
Fix string comparison in map reading
Diffstat (limited to 'src/game-server/mapreader.cpp')
-rw-r--r--src/game-server/mapreader.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/game-server/mapreader.cpp b/src/game-server/mapreader.cpp
index 24cc38c3..f9010fb1 100644
--- a/src/game-server/mapreader.cpp
+++ b/src/game-server/mapreader.cpp
@@ -179,7 +179,7 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
Rectangle rect = { objX, objY, objW, objH };
- if (utils::compareStrI(objType, "WARP"))
+ if (utils::compareStrI(objType, "WARP") == 0)
{
std::string destMapName = std::string();
int destX = -1;
@@ -200,16 +200,16 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
std::string value = XML::getProperty(
propertyNode, "name", std::string());
value = utils::toUpper(value);
- if (utils::compareStrI(value, "DEST_MAP"))
+ if (utils::compareStrI(value, "DEST_MAP") == 0)
{
destMapName = getObjectProperty(propertyNode,
std::string());
}
- else if (utils::compareStrI(value, "DEST_X"))
+ else if (utils::compareStrI(value, "DEST_X") == 0)
{
destX = getObjectProperty(propertyNode, -1);
}
- else if (utils::compareStrI(value, "DEST_Y"))
+ else if (utils::compareStrI(value, "DEST_Y") == 0)
{
destY = getObjectProperty(propertyNode, -1);
}
@@ -233,7 +233,7 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
LOG_WARN("Unrecognized warp format");
}
}
- else if (utils::compareStrI(objType, "SPAWN"))
+ else if (utils::compareStrI(objType, "SPAWN") == 0)
{
int monsterId = -1;
int maxBeings = 10; // Default value
@@ -252,15 +252,15 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
{
std::string value = XML::getProperty(propertyNode, "name", std::string());
value = utils::toUpper(value);
- if (utils::compareStrI(value, "MONSTER_ID"))
+ if (utils::compareStrI(value, "MONSTER_ID") == 0)
{
monsterId = getObjectProperty(propertyNode, monsterId);
}
- else if (utils::compareStrI(value, "MAX_BEINGS"))
+ else if (utils::compareStrI(value, "MAX_BEINGS") == 0)
{
maxBeings = getObjectProperty(propertyNode, maxBeings);
}
- else if (utils::compareStrI(value, "SPAWN_RATE"))
+ else if (utils::compareStrI(value, "SPAWN_RATE") == 0)
{
spawnRate = getObjectProperty(propertyNode, spawnRate);
}
@@ -279,7 +279,7 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
" for spawn area");
}
}
- else if (utils::compareStrI(objType, "NPC"))
+ else if (utils::compareStrI(objType, "NPC") == 0)
{
Script *s = composite->getScript();
if (!s)
@@ -305,11 +305,11 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
{
std::string value = XML::getProperty(propertyNode, "name", std::string());
value = utils::toUpper(value);
- if (utils::compareStrI(value, "NPC_ID"))
+ if (utils::compareStrI(value, "NPC_ID") == 0)
{
npcId = getObjectProperty(propertyNode, npcId);
}
- else if (utils::compareStrI(value, "SCRIPT"))
+ else if (utils::compareStrI(value, "SCRIPT") == 0)
{
scriptText = getObjectProperty(propertyNode, "");
}
@@ -326,7 +326,7 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
LOG_WARN("Unrecognized format for npc");
}
}
- else if (utils::compareStrI(objType, "SCRIPT"))
+ else if (utils::compareStrI(objType, "SCRIPT") == 0)
{
Script *s = composite->getScript();
if (!s)
@@ -352,12 +352,12 @@ Map* MapReader::readMap(xmlNodePtr node, const std::string &path,
{
std::string value = XML::getProperty(propertyNode, "name", std::string());
value = utils::toUpper(value);
- if (utils::compareStrI(value, "FILENAME"))
+ if (utils::compareStrI(value, "FILENAME") == 0)
{
scriptFilename = getObjectProperty(propertyNode, "");
utils::trim(scriptFilename);
}
- else if (utils::compareStrI(value, "TEXT"))
+ else if (utils::compareStrI(value, "TEXT") == 0)
{
scriptText = getObjectProperty(propertyNode, "");
}