mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 19:00:33 +02:00
Fix crash when trying to move to invalid co-ordinates
This commit is contained in:
@@ -136,6 +136,8 @@ int try_move(int i, int x, int y, int nx, int ny)
|
|||||||
|
|
||||||
if (x==nx && y==ny)
|
if (x==nx && y==ny)
|
||||||
return 1;
|
return 1;
|
||||||
|
if (nx<0 || ny<0 || nx>=XRES || ny>=YRES)
|
||||||
|
return 1;
|
||||||
|
|
||||||
e = eval_move(parts[i].type, nx, ny, &r);
|
e = eval_move(parts[i].type, nx, ny, &r);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user