Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Future-proof particles by resetting them completely when replaced.
  • Loading branch information
MajorCooke authored and coelckers committed Nov 13, 2022
1 parent 1047b76 commit f044695
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/playsim/p_effect.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit f044695

Please sign in to comment.