diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index cbe11c8c..68bf80f3 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -18,8 +18,6 @@ bool intermission = false; dynent *player1 = newdynent(); // our client dvector players; // other clients -vector physents; - VAR(sensitivity, 0, 10, 1000); VAR(sensitivityscale, 1, 1, 100); VAR(invmouse, 0, 0, 1); diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 71d961be..5ebb9cba 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -395,6 +395,8 @@ void moveplayer(dynent *pl, int moveres, bool local) loopi(physicsrepeat) moveplayer(pl, moveres, local, i ? curtime/physicsrepeat : curtime-curtime/physicsrepeat*(physicsrepeat-1)); }; +vector physents; + physent *new_physent() { physent *p = new physent; @@ -452,8 +454,14 @@ void mphysents() if(lastmillis - p->millis >= p->timetolife) { if(p->state==NADE_ACTIVATED || p->state==NADE_THROWED) explode_nade(physents[i]); + delete p; physents.remove(i); i--; }; }; }; + +void clearphysents() +{ + loopv(physents) if(physents[i]) { delete physents[i]; physents.remove(i); }; +} \ No newline at end of file