diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-03 00:32:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-03 00:32:00 +0300 |
commit | fa21c1b65dbe91a1e6ac880db977416162f268df (patch) | |
tree | 7fa06ef18a171d62ff892c99e710d4df7aff91b5 /src/resources/npcdb.cpp | |
parent | 0534847df83047f1ce2605187d45a762ffeae11e (diff) | |
download | ManaVerse-fa21c1b65dbe91a1e6ac880db977416162f268df.tar.gz ManaVerse-fa21c1b65dbe91a1e6ac880db977416162f268df.tar.bz2 ManaVerse-fa21c1b65dbe91a1e6ac880db977416162f268df.tar.xz ManaVerse-fa21c1b65dbe91a1e6ac880db977416162f268df.zip |
Add const to more classes.
Diffstat (limited to 'src/resources/npcdb.cpp')
-rw-r--r-- | src/resources/npcdb.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 40c7182f6..3ce300138 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -47,7 +47,7 @@ void NPCDB::load() logger->log1("Initializing NPC database..."); XML::Document doc("npcs.xml"); - XmlNodePtr rootNode = doc.rootNode(); + const XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, "npcs")) { @@ -62,14 +62,14 @@ void NPCDB::load() if (!xmlNameEqual(npcNode, "npc")) continue; - int id = XML::getProperty(npcNode, "id", 0); + const int id = XML::getProperty(npcNode, "id", 0); if (id == 0) { logger->log1("NPC Database: NPC with missing ID in npcs.xml!"); continue; } - BeingInfo *currentInfo = new BeingInfo; + BeingInfo *const currentInfo = new BeingInfo; if (serverVersion > 0) { @@ -93,7 +93,7 @@ void NPCDB::load() if (xmlNameEqual(spriteNode, "sprite")) { - SpriteReference *currentSprite = new SpriteReference; + SpriteReference *const currentSprite = new SpriteReference; currentSprite->sprite = reinterpret_cast<const char*>( spriteNode->xmlChildrenNode->content); currentSprite->variant = @@ -124,9 +124,9 @@ void NPCDB::unload() mLoaded = false; } -BeingInfo *NPCDB::get(int id) +BeingInfo *NPCDB::get(const int id) { - BeingInfoIterator i = mNPCInfos.find(id); + const BeingInfoIterator i = mNPCInfos.find(id); if (i == mNPCInfos.end()) { |