mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 18:26:03 +00:00
Moved implementation of [store_turns] to Lua.
This commit is contained in:
parent
74818fff9b
commit
1487d54166
@ -374,3 +374,8 @@ function wml_actions.remove_unit_overlay(cfg)
|
||||
wesnoth.put_unit(ucfg)
|
||||
end
|
||||
end
|
||||
|
||||
function wml_actions.store_turns(cfg)
|
||||
local var = cfg.variable or "turns"
|
||||
wesnoth.set_variable(var, wesnoth.game_config.last_turn)
|
||||
end
|
||||
|
@ -983,16 +983,6 @@ WML_HANDLER_FUNCTION(modify_turns, /*event_info*/, cfg)
|
||||
}
|
||||
}
|
||||
|
||||
WML_HANDLER_FUNCTION(store_turns, /*event_info*/, cfg)
|
||||
{
|
||||
std::string var_name = cfg["variable"];
|
||||
if(var_name.empty()) {
|
||||
var_name = "turns";
|
||||
}
|
||||
int turns = resources::tod_manager->number_of_turns();
|
||||
resources::state_of_game->get_variable(var_name) = turns;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
std::auto_ptr<unit> create_fake_unit(const vconfig& cfg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user