memory leak fixed

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@506 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2006-11-06 20:02:28 +00:00
parent fb99d038f6
commit 301acb6efb
2 changed files with 8 additions and 2 deletions
-2
View File
@@ -18,8 +18,6 @@ bool intermission = false;
dynent *player1 = newdynent(); // our client
dvector players; // other clients
vector <physent *>physents;
VAR(sensitivity, 0, 10, 1000);
VAR(sensitivityscale, 1, 1, 100);
VAR(invmouse, 0, 0, 1);
+8
View File
@@ -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 <physent *>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); };
}