diff --git a/data/lua/core/_initial.lua b/data/lua/core/_initial.lua index 7dee5156c4b..6cf3ea34666 100644 --- a/data/lua/core/_initial.lua +++ b/data/lua/core/_initial.lua @@ -149,16 +149,16 @@ if wesnoth.kernel_type() == 'Game Lua Kernel' then end return get_tod(loc, turn) end - + local function liminal_bonus(...) return wesnoth.current.schedule.liminal_bonus end - + wesnoth.get_time_of_day = wesnoth.deprecate_api('wesnoth.get_time_of_day', 'wesnoth.schedule.get_time_of_day or wesnoth.schedule.get_illumination', 1, nil, get_time_of_day, 'The arguments have changed') wesnoth.set_time_of_day = wesnoth.deprecate_api('wesnoth.set_time_of_day', 'wesnoth.current.schedule.time_of_day', 4, nil, nil) wesnoth.get_max_liminal_bonus = wesnoth.deprecate_api('wesnoth.get_max_liminal_bonus', 'wesnoth.current.schedule.liminal_bonus', 1, nil, liminal_bonus, "It's now a read-write attribute") wesnoth.replace_schedule = wesnoth.deprecate_api('wesnoth.replace_schedule', 'wesnoth.schedule.replace', 1, nil, wesnoth.schedule.replace) - + wesnoth.get_traits = wesnoth.deprecate_api('wesnoth.get_traits', 'wesnoth.game_config.global_traits', 1, nil, function() return wesnoth.game_config.global_traits end) wesnoth.end_level = wesnoth.deprecate_api('wesnoth.end_level', 'wesnoth.scenario.end_level_data assignment', 1, nil, function(cfg) wesnoth.scenario.end_level_data = cfg end) wesnoth.get_end_level_data = wesnoth.deprecate_api('wesnoth.get_end_level_data', 'wesnoth.scenario.end_level_data', 1, nil, function() return wesnoth.scenario.end_level_data end) diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index de742d6e871..569819fba18 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -960,7 +960,7 @@ int game_lua_kernel::impl_schedule_get(lua_State *L) return_string_attrib("time_of_day", tod_man().get_time_of_day().id); return_int_attrib("liminal_bonus", tod_man().get_max_liminal_bonus()); } - + if(luaW_getglobal(L, "wesnoth", "schedule", m)) { return 1; } @@ -1117,7 +1117,7 @@ int game_lua_kernel::intf_get_time_of_day(lua_State *L) // We just need SOME location in that area, it doesn't matter which one. loc = *area.begin(); } - + if(lua_isnumber(L, 2)) { for_turn = luaL_checkinteger(L, 1); int number_of_turns = tod_man().number_of_turns(); @@ -3834,7 +3834,7 @@ int game_lua_kernel::intf_replace_schedule(lua_State * L) // Replace the global schedule with a time area's schedule // The expectation is that you call schedule.replace(time_area.schedule), // rather than passing a literal location. - + } else { vconfig cfg = luaW_checkvconfig(L, 1); @@ -4430,7 +4430,7 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports luaL_setfuncs(L, audio_callbacks, 0); lua_setfield(L, -2, "audio"); lua_pop(L, 1); - + // Create the schedule module cmd_log_ << "Adding schedule module...\n"; static luaL_Reg const schedule_callbacks[] {