fix [lua] tags beeing lost on reload

This commit is contained in:
gfgtdf 2015-10-05 22:12:41 +00:00
parent 1f3aeb6574
commit eaa192ffa8
2 changed files with 2 additions and 9 deletions

View File

@ -110,6 +110,7 @@ static void copy_persistent(const config& src, config& dst)
static stringset tags = boost::assign::list_of
("terrain_graphics")
("lua")
.convert_to_container<stringset>();
BOOST_FOREACH(const std::string& attr, attrs)
@ -512,17 +513,11 @@ void play_controller::init_side_end()
config play_controller::to_config() const
{
config cfg;
config cfg = level_;
cfg.merge_attributes(level_);
cfg["replay_pos"] = saved_game_.get_replay().get_pos();
gamestate().write(cfg);
// Write terrain_graphics data in snapshot, too
BOOST_FOREACH(const config& tg, level_.child_range("terrain_graphics")) {
cfg.add_child("terrain_graphics", tg);
}
gui_->write(cfg.add_child("display"));
//Write the soundsources.

View File

@ -4733,8 +4733,6 @@ void game_lua_kernel::load_game(const config& level)
*/
void game_lua_kernel::save_game(config &cfg)
{
cfg.append_children(cfg, "lua");
lua_State *L = mState;
if (!luaW_getglobal(L, "wesnoth", "game_events", "on_save", NULL))