]> git.localhorst.tv Git - blobs.git/blobdiff - src/world/world.cpp
track a few things
[blobs.git] / src / world / world.cpp
index d7e293a5509d2d456c88cbca5b09daa44fdb49ba..b80be094129011d029098b23b5986753e61d5f2d 100644 (file)
@@ -58,9 +58,6 @@ Body::Body()
 }
 
 Body::~Body() {
-       for (creature::Creature *c : creatures) {
-               delete c;
-       }
 }
 
 void Body::SetSimulation(Simulation &s) noexcept {
@@ -156,7 +153,7 @@ void Body::Tick(double dt) {
        // first remove creatures so they don't collide
        for (auto c = Creatures().begin(); c != Creatures().end();) {
                if ((*c)->Removable()) {
-                       delete *c;
+                       (*c)->Removed();
                        c = Creatures().erase(c);
                } else {
                        ++c;