diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-09-28 21:26:48 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-09-28 21:26:48 +0200 |
commit | 3c89797394c83db8bc2204fdf5841dd3068f09d0 (patch) | |
tree | 6fc2d3ad06b9d589851397ff723a32b231a100de /src/resources/npcdb.cpp | |
parent | 51f0c23ac190c83bebeace8a49cd2ecd1143fa8c (diff) | |
download | mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.tar.gz mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.tar.bz2 mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.tar.xz mana-3c89797394c83db8bc2204fdf5841dd3068f09d0.zip |
Removed getter/setter cruft from ItemInfo
Made the class and the code in general more readable by removing all
the needless getters and setters.
Diffstat (limited to 'src/resources/npcdb.cpp')
-rw-r--r-- | src/resources/npcdb.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 164dec18..09537c17 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -65,15 +65,14 @@ void NPCDB::readNPCNode(xmlNodePtr node, const std::string &filename) { if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { - SpriteReference currentSprite; + SpriteReference ¤tSprite = display.sprites.emplace_back(); currentSprite.sprite = (const char*)spriteNode->xmlChildrenNode->content; currentSprite.variant = XML::getProperty(spriteNode, "variant", 0); - display.sprites.push_back(currentSprite); } else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) { - std::string particlefx = (const char*)spriteNode->xmlChildrenNode->content; - display.particles.push_back(particlefx); + display.particles.emplace_back( + (const char*)spriteNode->xmlChildrenNode->content); } } |