X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fworld%2Fworld.cpp;h=b80be094129011d029098b23b5986753e61d5f2d;hp=d7e293a5509d2d456c88cbca5b09daa44fdb49ba;hb=392826deaf802ac0960ed3924a3f98b9d18d381b;hpb=b4deadd9f4e399207e2530ea39a447c0d9d260a3 diff --git a/src/world/world.cpp b/src/world/world.cpp index d7e293a..b80be09 100644 --- a/src/world/world.cpp +++ b/src/world/world.cpp @@ -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;