aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-11-09 08:05:37 -0500
committerClyne Sullivan <tullivan99@gmail.com>2015-11-09 08:05:37 -0500
commit9748d6306db7aa66128baeeca4c2a27b0efa1d87 (patch)
tree18b36403d0e622dce03a872cc21bb081e30dbecb /src/entities.cpp
parentd54da1ea2b315a2ada023d189c31571949d25d06 (diff)
worlds have indepentdent entity arrays
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index acc45bd..9a3730e 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -1,14 +1,11 @@
#include <entities.h>
#include <ui.h>
-std::vector<Entity *> entity;
-std::vector<NPC *> npc;
-std::vector<Structures *> build;
-std::vector<Mob *> mob;
-
extern FILE* names;
extern unsigned int loops;
+extern World *currentWorld;
+
void Entity::spawn(float x, float y){ //spawns the entity you pass to it based off of coords and global entity settings
loc.x = x;
loc.y = y;
@@ -317,10 +314,7 @@ unsigned int Structures::spawn(_TYPE t, float x, float y){ //spawns a structure
* with type NPC by using polymorphism.
*/
- npc.push_back(new NPC());
- npc.back()->spawn(loc.x+(i-5),100);
-
- entity.push_back(npc.back());
+ currentWorld->addNPC(loc.x+(i-5),100);
}
break;