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:
@@ -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);
|
||||
|
||||
@@ -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); };
|
||||
}
|
||||
Reference in New Issue
Block a user