diff options
Diffstat (limited to 'src/elements/pcln.c')
| -rw-r--r-- | src/elements/pcln.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/elements/pcln.c b/src/elements/pcln.c index 3f785bb..45cfc79 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<=0 || parts[i].ctype>=PT_NUM) + if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || (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) @@ -41,7 +41,11 @@ int update_PCLN(UPDATE_FUNC_ARGS) { (r&0xFF)!=PT_NSCN && (r&0xFF)!=PT_PSCN && (r&0xFF)!=PT_STKM && (r&0xFF)!=PT_STKM2 && (r&0xFF)!=PT_PBCN && (r&0xFF)<PT_NUM) - parts[i].ctype = r&0xFF; + { + parts[i].ctype = r&0xFF; + if ((r&0xFF)==PT_LIFE) + 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==PT_PHOT) {//create photons a different way @@ -55,10 +59,10 @@ int update_PCLN(UPDATE_FUNC_ARGS) { } } } - else if (ptypes[parts[i].ctype].properties&PROP_LIFE) {//create life a different way + else if (parts[i].ctype==PT_LIFE) {//create life a different way for (rx=-1; rx<2; rx++) { for (ry=-1; ry<2; ry++) { - create_part(-1, x+rx, y+ry, parts[i].ctype); + create_part(-1, x+rx, y+ry, parts[i].ctype|(parts[i].tmp<<8)); } } } else { |
