Detected invalid locations before they are passed to the pathfinder.

(Fix for bug #17448.)
This commit is contained in:
Guillaume Melquiond 2011-01-15 09:52:26 +00:00
parent 6e086902eb
commit 0f74f8c791

View file

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