diff options
Diffstat (limited to 'src/elements/pcln.c')
| -rw-r--r-- | src/elements/pcln.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/elements/pcln.c b/src/elements/pcln.c index 8afa656..3ba431c 100644 --- a/src/elements/pcln.c +++ b/src/elements/pcln.c @@ -26,7 +26,7 @@ int update_PCLN(UPDATE_FUNC_ARGS) { parts[i].life = 10; } } - if (!parts[i].ctype) + if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM) 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) @@ -43,7 +43,7 @@ int update_PCLN(UPDATE_FUNC_ARGS) { (r&0xFF)<PT_NUM) parts[i].ctype = r&0xFF; } - if (parts[i].ctype && parts[i].life==10) { + if (parts[i].ctype>0 && parts[i].ctype<PT_NUM && parts[i].life==10) { if (parts[i].ctype==PT_PHOT) {//create photons a different way for (rx=-1; rx<2; rx++) { for (ry=-1; ry<2; ry++) { |
