diff --git a/src/elements/pbcn.c b/src/elements/pbcn.c index bfd65d52f..3c41820d0 100644 --- a/src/elements/pbcn.c +++ b/src/elements/pbcn.c @@ -17,28 +17,6 @@ int update_PBCN(UPDATE_FUNC_ARGS) { return 1; } } - for (rx=-2; rx<3; rx++) - for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx>8)>=NPART || !r) - continue; - if ((r&0xFF)==PT_SPRK) - { - if (parts[r>>8].ctype==PT_PSCN) - parts[i].life = 10; - else if (parts[r>>8].ctype==PT_NSCN) - parts[i].life = 9; - } - if ((r&0xFF)==PT_PBCN) - { - if (parts[i].life==10&&parts[r>>8].life<10&&parts[r>>8].life>0) - parts[i].life = 9; - else if (parts[i].life==0&&parts[r>>8].life==10) - parts[i].life = 10; - } - } if (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM) for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) @@ -56,6 +34,25 @@ int update_PBCN(UPDATE_FUNC_ARGS) { (r&0xFF)!=PT_PBCN && (r&0xFF)=0 && y+ry>0 && x+rx>8)>=NPART || !r) + continue; + if ((r&0xFF)==PT_PBCN) + { + if (parts[r>>8].life<10&&parts[r>>8].life>0) + parts[i].life = 9; + else if (parts[r>>8].life==0) + parts[r>>8].life = 10; + } + } + } if (parts[i].ctype>0 && parts[i].ctype>8].life = 9; } } - else if ((ct==PT_PSCN||ct==PT_NSCN) && (rt==PT_PUMP||rt==PT_GPMP||rt==PT_HSWC||(rt==PT_LCRY&&abs(rx)<2&&abs(ry)<2))) // PROP_PTOGGLE, Maybe? We seem to use 2 different methods for handling actived elements, this one seems better + else if ((ct==PT_PSCN||ct==PT_NSCN) && (rt==PT_PUMP||rt==PT_GPMP||rt==PT_HSWC||rt==PT_PBCN||(rt==PT_LCRY&&abs(rx)<2&&abs(ry)<2))) // PROP_PTOGGLE, Maybe? We seem to use 2 different methods for handling actived elements, this one seems better. Yes, use this one for new elements, PCLN is different for compatibility with existing saves { if (ct==PT_PSCN) parts[r>>8].life = 10; else if (ct==PT_NSCN && parts[r>>8].life>=10) parts[r>>8].life = 9;