Fix infinite spark loops in photoelectric effect

This commit is contained in:
jacob1 2021-01-19 20:54:03 -05:00
parent c48641dd67
commit d037178bb5

View File

@ -2887,7 +2887,7 @@ void Simulation::photoelectric_effect(int nx, int ny)//create sparks from PHOT w
{
unsigned r = pmap[ny][nx];
if (TYP(r) == PT_PSCN)
if (TYP(r) == PT_PSCN && !parts[ID(r)].life)
{
if (TYP(pmap[ny][nx-1]) == PT_NSCN || TYP(pmap[ny][nx+1]) == PT_NSCN ||
TYP(pmap[ny-1][nx]) == PT_NSCN || TYP(pmap[ny+1][nx]) == PT_NSCN)