From d7efa99f03f9d0eb5d84ed42249f227f13471079 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 16 Sep 2015 11:33:02 -0400 Subject: shitty bug fixes --- src/World.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/World.cpp') diff --git a/src/World.cpp b/src/World.cpp index bde35de..49bdf0d 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -24,6 +24,7 @@ World::World(const float width,World *l,World *r){ toRight=r; behind=infront=NULL; entCount=0; + entity=(void **)calloc(MAX_ENTITIES,sizeof(void *)); if(toLeft){ // Make sure linked worlds link back if(toLeft->toRight){ std::cout<<"There's already a world to the left!"<draw(); + if(entity[i]) + ((Entity **)entity)[i]->draw(); } } } @@ -134,6 +136,6 @@ void World::addLayer(const float width){ behind->infront=this; } } -void World::addEntity(void *e){ - entity[entCount++]=e; // duh +void World::addEntity(void *addr){ + entity[entCount++]=addr; } -- cgit v1.2.3