Author: cazfi
Date: Sun Feb  8 08:32:13 2015
New Revision: 28035

URL: http://svn.gna.org/viewcvs/freeciv?rev=28035&view=rev
Log:
Added experimental scenario option to try to use what ever ruleset is already 
loaded
before loading the scenario. 

See patch #5785

Modified:
    trunk/common/packets.def
    trunk/fc_version
    trunk/server/savegame3.c

Modified: trunk/common/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/packets.def?rev=28035&r1=28034&r2=28035&view=diff
==============================================================================
--- trunk/common/packets.def    (original)
+++ trunk/common/packets.def    Sun Feb  8 08:32:13 2015
@@ -1811,6 +1811,7 @@
   BOOL   startpos_nations;
   BOOL   prevent_new_cities;
   BOOL   handmade;
+  BOOL   ruleset_locked;
 end
 
 PACKET_SAVE_SCENARIO = 181; cs, handle-per-conn, dsend

Modified: trunk/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=28035&r1=28034&r2=28035&view=diff
==============================================================================
--- trunk/fc_version    (original)
+++ trunk/fc_version    Sun Feb  8 08:32:13 2015
@@ -54,7 +54,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2015.Jan.27"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2015.Feb.08"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: trunk/server/savegame3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame3.c?rev=28035&r1=28034&r2=28035&view=diff
==============================================================================
--- trunk/server/savegame3.c    (original)
+++ trunk/server/savegame3.c    Sun Feb  8 08:32:13 2015
@@ -1453,16 +1453,18 @@
   (void) secfile_entry_by_path(loading->file, "savefile.reason");
   (void) secfile_entry_by_path(loading->file, "savefile.revision");
 
-  /* Load ruleset. */
-  sz_strlcpy(game.server.rulesetdir,
-             secfile_lookup_str_default(loading->file, "classic",
-                                        "savefile.rulesetdir"));
-  if (!strcmp("default", game.server.rulesetdir)) {
-    sz_strlcpy(game.server.rulesetdir, "classic");
-  }
-  if (!load_rulesets(NULL, FALSE, TRUE, FALSE)) {
-    /* Failed to load correct ruleset */
-    sg_failure_ret(TRUE, "Failed to load ruleset");
+  if (!game.scenario.is_scenario || game.scenario.ruleset_locked) {
+    /* Load ruleset. */
+    sz_strlcpy(game.server.rulesetdir,
+               secfile_lookup_str_default(loading->file, "classic",
+                                          "savefile.rulesetdir"));
+    if (!strcmp("default", game.server.rulesetdir)) {
+      sz_strlcpy(game.server.rulesetdir, "classic");
+    }
+    if (!load_rulesets(NULL, FALSE, TRUE, FALSE)) {
+      /* Failed to load correct ruleset */
+      sg_failure_ret(TRUE, "Failed to load ruleset");
+    }
   }
 
   /* Load improvements. */
@@ -2327,6 +2329,10 @@
     game.scenario.handmade
       = secfile_lookup_bool_default(loading->file, FALSE,
                                     "scenario.handmade");
+
+    game.scenario.ruleset_locked
+      = secfile_lookup_bool_default(loading->file, TRUE,
+                                    "scenario.ruleset_locked");
 
     sg_failure_ret(loading->server_state == S_S_INITIAL
                    || (loading->server_state == S_S_RUNNING


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to