summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-03-21 16:26:58 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2011-03-21 16:26:58 (GMT)
commitdf27f8420d8bbbf645be6962706a48728859618f (patch)
treee424039bf427669aac219a1740253fdbb4bb3823 /src
parent993fb876c92289a65a24de2264924d074ab3a944 (diff)
downloadpowder-df27f8420d8bbbf645be6962706a48728859618f.zip
powder-df27f8420d8bbbf645be6962706a48728859618f.tar.gz
Fix crash when trying to move to invalid co-ordinates
Diffstat (limited to 'src')
-rw-r--r--src/powder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/powder.c b/src/powder.c
index 7e26422..b77a52d 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -136,6 +136,8 @@ int try_move(int i, int x, int y, int nx, int ny)
if (x==nx && y==ny)
return 1;
+ if (nx<0 || ny<0 || nx>=XRES || ny>=YRES)
+ return 1;
e = eval_move(parts[i].type, nx, ny, &r);