diff options
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 12 |
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; |