Detected invalid locations before they are passed to the pathfinder.
(Fix for bug #17448.)
This commit is contained in:
parent
6e086902eb
commit
0f74f8c791
1 changed files with 5 additions and 0 deletions
|
@ -1836,6 +1836,11 @@ static int intf_find_path(lua_State *L)
|
|||
dst.y = luaL_checkinteger(L, arg) - 1;
|
||||
++arg;
|
||||
|
||||
if (!resources::game_map->on_board(src))
|
||||
return luaL_argerror(L, 1, "invalid location");
|
||||
if (!resources::game_map->on_board(dst))
|
||||
return luaL_argerror(L, arg - 2, "invalid location");
|
||||
|
||||
std::vector<team> &teams = *resources::teams;
|
||||
gamemap &map = *resources::game_map;
|
||||
int viewing_side = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue