diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2013-01-23 19:20:52 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2013-01-23 19:20:52 (GMT) |
| commit | 6c89c63a44b252c2ddffb77e3c07a8e0147d77bf (patch) | |
| tree | 557fa11a8a0c9c467110ed09a7d467c6e1cc6b27 /src/simulation/elements/PSTN.cpp | |
| parent | 0034dd654e2cb4814da6303806d0c03df34ad3dd (diff) | |
| download | powder-6c89c63a44b252c2ddffb77e3c07a8e0147d77bf.zip powder-6c89c63a44b252c2ddffb77e3c07a8e0147d77bf.tar.gz | |
PSTN: Do not accept current from diagonals, increase distance for spark checks
Diffstat (limited to 'src/simulation/elements/PSTN.cpp')
| -rw-r--r-- | src/simulation/elements/PSTN.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp index 7e4aaa6..d49ce01 100644 --- a/src/simulation/elements/PSTN.cpp +++ b/src/simulation/elements/PSTN.cpp @@ -65,9 +65,9 @@ int Element_PSTN::update(UPDATE_FUNC_ARGS) int r, nxx, nyy, nxi, nyi, rx, ry; int directionX = 0, directionY = 0; if (parts[i].life==0 && state == PISTON_INACTIVE) { - 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 && (rx || ry)) + 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) && (!rx || !ry)) { r = pmap[y+ry][x+rx]; if (!r) |
