diff options
Diffstat (limited to 'src/elements/pcln.cpp')
| -rw-r--r-- | src/elements/pcln.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/elements/pcln.cpp b/src/elements/pcln.cpp index 86d67f6..4fdffb6 100644 --- a/src/elements/pcln.cpp +++ b/src/elements/pcln.cpp @@ -49,12 +49,19 @@ int update_PCLN(UPDATE_FUNC_ARGS) { } 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++) { - int r = sim->create_part(-1, x+rx, y+ry, parts[i].ctype); - if (r!=-1) { - parts[r].vx = rx*3; - parts[r].vy = ry*3; + for (rx=-1; rx<2; rx++) + { + for (ry = -1; ry < 2; ry++) + { + if (rx || ry) + { + int r = sim->create_part(-1, x + rx, y + ry, + parts[i].ctype); + if (r != -1) + { + parts[r].vx = rx * 3; + parts[r].vy = ry * 3; + } } } } |
