From df27f8420d8bbbf645be6962706a48728859618f Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Mon, 21 Mar 2011 16:26:58 +0000 Subject: [PATCH] Fix crash when trying to move to invalid co-ordinates --- src/powder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/powder.c b/src/powder.c index 7e26422d3..b77a52d81 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);