diff options
| author | cracker64 <cracker642@gmail.com> | 2013-02-27 22:20:05 (GMT) |
|---|---|---|
| committer | cracker64 <cracker642@gmail.com> | 2013-02-27 22:20:05 (GMT) |
| commit | 08d1a68ce091b6ba53788224fd1bda92c1895ca6 (patch) | |
| tree | 09593de4276750ce9abf203edb08741947ba7ab6 /src/simulation/elements/BCLN.cpp | |
| parent | 3d2e59415003c51c0b6dbe764003cc2012ba9ca7 (diff) | |
| download | powder-08d1a68ce091b6ba53788224fd1bda92c1895ca6.zip powder-08d1a68ce091b6ba53788224fd1bda92c1895ca6.tar.gz | |
More fixes.
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; } } |
