Added small hack to ease loading of middle-of-scenario 1.6 savefiles.

To be removed for 1.10.
This commit is contained in:
Guillaume Melquiond 2009-12-08 20:52:48 +00:00
parent 5d47584a12
commit 6e004820b5

View File

@ -263,6 +263,16 @@ LEVEL_RESULT play_game(display& disp, game_state& gamestate, const config& game_
if (!gamestate.snapshot["label"].empty()){
gamestate.classification().label = gamestate.snapshot["label"];
}
// Helper for transitioning middle-of-scenario savefiles from 1.6 to 1.8.
// To be removed for 1.10.
if (!scenario->find_child("event", "name", "preload")) {
LOG_NG << "Adding dummy preload event.\n";
config &ev = gamestate.snapshot.add_child("event");
ev["name"] = "preload";
ev["first_time_only"] = "no";
config &lua = ev.add_child("lua");
lua["code"] = "wesnoth.dofile 'lua/wml-tags.lua'";
}
}
controller_map controllers;