Fix crash when trying to move to invalid co-ordinates

This commit is contained in:
jacksonmj 2011-03-21 16:26:58 +00:00
parent 993fb876c9
commit df27f8420d

View File

@ -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);