mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-22 20:11:14 +00:00
Future-proof particles by resetting them completely when replaced.
This commit is contained in:
parent
1047b766df
commit
f044695d28
1 changed files with 5 additions and 0 deletions
|
@ -130,6 +130,11 @@ inline particle_t *NewParticle (FLevelLocals *Level, bool replace = false)
|
||||||
particle_t* ntop = &Level->Particles[result->tnext];
|
particle_t* ntop = &Level->Particles[result->tnext];
|
||||||
ntop->tprev = Level->ActiveParticles;
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue