mail[Wesnoth-commits] r40173 - /trunk/src/playcampaign.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on December 08, 2009 - 21:52:
Author: silene
Date: Tue Dec  8 21:52:48 2009
New Revision: 40173

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40173&view=rev
Log:
Added small hack to ease loading of middle-of-scenario 1.6 savefiles. To be 
removed for 1.10.

Modified:
    trunk/src/playcampaign.cpp

Modified: trunk/src/playcampaign.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playcampaign.cpp?rev=40173&r1=40172&r2=40173&view=diff
==============================================================================
--- trunk/src/playcampaign.cpp (original)
+++ trunk/src/playcampaign.cpp Tue Dec  8 21:52:48 2009
@@ -263,6 +263,16 @@
                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;




Related Messages


Powered by MHonArc, Updated Wed Dec 09 00:00:15 2009