aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 113d98a..71bd0f4 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -1482,12 +1482,13 @@ World *loadWorldFromXML(const char *path){
}else if(!strcmp(name,"npc")){
const char *npcname;
-
+
if(wxml->QueryFloatAttribute("x",&spawnx) != XML_NO_ERROR)
tmp->addNPC(getRand() % tmp->getTheWidth() / 2.0f,100);
else
tmp->addNPC(spawnx,wxml->FloatAttribute("y"));
+
if((npcname = wxml->Attribute("name"))){
delete[] tmp->npc.back()->name;
tmp->npc.back()->name = new char[strlen(npcname) + 1];