Moved implementation of [store_turns] to Lua.

This commit is contained in:
Guillaume Melquiond 2010-07-22 20:06:16 +00:00
parent 74818fff9b
commit 1487d54166
2 changed files with 5 additions and 10 deletions

View file

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

View file

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