Fix crash when trying to move to invalid co-ordinates
This commit is contained in:
parent
993fb876c9
commit
df27f8420d
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user