diff options
| author | Pilihp <pilihp@pilihp-Z68MA-D2H-B3.(none)> | 2013-02-26 23:42:36 (GMT) |
|---|---|---|
| committer | Pilihp <pilihp@pilihp-Z68MA-D2H-B3.(none)> | 2013-02-26 23:42:36 (GMT) |
| commit | 8d66b62e3d237cca2a8489cae21001170d58d590 (patch) | |
| tree | ddbc36591a9043334b2fc684722ffd334894da83 /src/simulation/elements/BTRY.cpp | |
| parent | e700ff29883fcc3479ad8d9fce9805fbb0d31dfa (diff) | |
| download | powder-8d66b62e3d237cca2a8489cae21001170d58d590.zip powder-8d66b62e3d237cca2a8489cae21001170d58d590.tar.gz | |
Lots of small optimizations and things, nothing should be functionally different.
Only gotten through a few elements, more later.
Diffstat (limited to 'src/simulation/elements/BTRY.cpp')
| -rw-r--r-- | src/simulation/elements/BTRY.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/simulation/elements/BTRY.cpp b/src/simulation/elements/BTRY.cpp index efbb3d2..4f1e810 100644 --- a/src/simulation/elements/BTRY.cpp +++ b/src/simulation/elements/BTRY.cpp @@ -52,15 +52,15 @@ int Element_BTRY::update(UPDATE_FUNC_ARGS) int r, rx, ry, rt; for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) - if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) + if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry) && abs(rx)+abs(ry)<4) { r = pmap[y+ry][x+rx]; if (!r) continue; - rt = parts[r>>8].type; + rt = (r&0xFF); if (sim->parts_avg(i,r>>8,PT_INSL) != PT_INSL) { - if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0 && abs(rx)+abs(ry) < 4) + if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0) { parts[r>>8].life = 4; parts[r>>8].ctype = rt; @@ -72,4 +72,4 @@ int Element_BTRY::update(UPDATE_FUNC_ARGS) } -Element_BTRY::~Element_BTRY() {}
\ No newline at end of file +Element_BTRY::~Element_BTRY() {} |
