summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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);