diff options
Diffstat (limited to 'src/simulation/elements/BCLN.cpp')
| -rw-r--r-- | src/simulation/elements/BCLN.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/simulation/elements/BCLN.cpp b/src/simulation/elements/BCLN.cpp index 80a5d44..a617620 100644 --- a/src/simulation/elements/BCLN.cpp +++ b/src/simulation/elements/BCLN.cpp @@ -59,7 +59,7 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS) } 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))) { - int r, rx, ry; + int r, rx, ry, rt; 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) @@ -69,13 +69,14 @@ int Element_BCLN::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)!=PT_CLNE && (r&0xFF)!=PT_PCLN && - (r&0xFF)!=PT_BCLN && (r&0xFF)!=PT_STKM && - (r&0xFF)!=PT_PBCN && (r&0xFF)!=PT_STKM2 && - (r&0xFF)<PT_NUM) + rt = r&0xFF; + if (rt!=PT_CLNE && rt!=PT_PCLN && + rt!=PT_BCLN && rt!=PT_STKM && + rt!=PT_PBCN && rt!=PT_STKM2 && + rt<PT_NUM) { - parts[i].ctype = r&0xFF; - if ((r&0xFF)==PT_LIFE || (r&0xFF)==PT_LAVA) + parts[i].ctype = rt; + if (rt==PT_LIFE || rt==PT_LAVA) parts[i].tmp = parts[r>>8].ctype; } } |
