summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2012-04-18 14:57:27 (GMT)
committer cracker64 <cracker642@gmail.com>2012-04-18 14:57:27 (GMT)
commitc0947d9fea1e94261a0d65d474b2f476e9bec30a (patch)
tree251b70e598ffce4cc62d3a5b1a8e19e479d20253 /src/elements
parent64629df1af70e49300927a2a38df389c4bb4984c (diff)
downloadpowder-c0947d9fea1e94261a0d65d474b2f476e9bec30a.zip
powder-c0947d9fea1e94261a0d65d474b2f476e9bec30a.tar.gz
Should fix any border crashes
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/tron.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/elements/tron.c b/src/elements/tron.c
index 83d293a..90b75fd 100644
--- a/src/elements/tron.c
+++ b/src/elements/tron.c
@@ -61,7 +61,7 @@ int trymovetron(int x, int y, int dir, int i, int len)
for (tx = rx - tron_ry[dir] , ty = ry - tron_rx[dir], j=1; abs(tx-rx) < (len-k) && abs(ty-ry) < (len-k); tx-=tron_ry[dir],ty-=tron_rx[dir],j++)
{
r = pmap[ty][tx];
- if (!r && !bmap[(ty)/CELL][(tx)/CELL] && ry > CELL && rx > CELL && ry < YRES-CELL && rx < XRES-CELL)
+ if (!r && !bmap[(ty)/CELL][(tx)/CELL] && ty > CELL && tx > CELL && ty < YRES-CELL && tx < XRES-CELL)
{
if (j == (len-k))//there is a safe path, so we can break out
return len+1;
@@ -73,7 +73,7 @@ int trymovetron(int x, int y, int dir, int i, int len)
for (tx = rx + tron_ry[dir] , ty = ry + tron_rx[dir], j=1; abs(tx-rx) < (len-k) && abs(ty-ry) < (len-k); tx+=tron_ry[dir],ty+=tron_rx[dir],j++)
{
r = pmap[ty][tx];
- if (!r && !bmap[(ty)/CELL][(tx)/CELL] && ry > CELL && rx > CELL && ry < YRES-CELL && rx < XRES-CELL)
+ if (!r && !bmap[(ty)/CELL][(tx)/CELL] && ty > CELL && tx > CELL && ty < YRES-CELL && tx < XRES-CELL)
{
if (j == (len-k))
return len+1;