diff options
Diffstat (limited to 'src/simulation/elements/PCLN.cpp')
| -rw-r--r-- | src/simulation/elements/PCLN.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simulation/elements/PCLN.cpp b/src/simulation/elements/PCLN.cpp index 1b814b0..7e6b3d7 100644 --- a/src/simulation/elements/PCLN.cpp +++ b/src/simulation/elements/PCLN.cpp @@ -74,7 +74,7 @@ int Element_PCLN::update(UPDATE_FUNC_ARGS) parts[i].life = 10; } } - if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOLALT))) + if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || !sim->elements[parts[i].ctype].Enabled || (parts[i].ctype==PT_LIFE && (parts[i].tmp<0 || parts[i].tmp>=NGOLALT))) for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES) @@ -95,7 +95,7 @@ int Element_PCLN::update(UPDATE_FUNC_ARGS) parts[i].tmp = parts[r>>8].ctype; } } - if (parts[i].ctype>0 && parts[i].ctype<PT_NUM && parts[i].life==10) { + if (parts[i].ctype>0 && parts[i].ctype<PT_NUM && sim->elements[parts[i].ctype].Enabled && parts[i].life==10) { if (parts[i].ctype==PT_PHOT) {//create photons a different way for (rx=-1; rx<2; rx++) { |
