Future-proof particles by resetting them completely when replaced.

This commit is contained in:
Major Cooke 2022-11-13 12:58:34 -06:00 committed by Christoph Oelckers
parent 1047b766df
commit f044695d28

View file

@ -130,6 +130,11 @@ inline particle_t *NewParticle (FLevelLocals *Level, bool replace = false)
particle_t* ntop = &Level->Particles[result->tnext];
ntop->tprev = Level->ActiveParticles;
}
auto tnext = result->tnext;
auto tprev = result->tprev;
memset(result, 0, sizeof(particle_t));
result->tnext = tnext;
result->tprev = tprev;
}
return result;
}