Get [time_area] id from the config instead of passing it as a lua arg

This fixes [time_area] id= inadvertently becoming required, when it should be optional
This commit is contained in:
Charles Dang 2015-01-04 23:25:49 +11:00
parent e9ed01ee5f
commit e1e5169c95
2 changed files with 3 additions and 3 deletions

View file

@ -1345,7 +1345,7 @@ function wml_actions.time_area(cfg)
if remove then
wesnoth.remove_time_area(cfg.id)
else
wesnoth.add_time_area(cfg.id, cfg)
wesnoth.add_time_area(cfg)
end
end

View file

@ -3415,8 +3415,8 @@ int game_lua_kernel::intf_add_time_area(lua_State * L)
{
log_scope("time_area");
std::string ids = luaL_checkstring(L, 1);
vconfig cfg(luaW_checkvconfig(L, 2));
vconfig cfg(luaW_checkvconfig(L, 1));
std::string ids = cfg["id"];
std::string id;
if(ids.find(',') != std::string::npos) {