Moved implementation of [store_turns] to Lua.
This commit is contained in:
parent
74818fff9b
commit
1487d54166
2 changed files with 5 additions and 10 deletions
|
@ -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…
Add table
Reference in a new issue