Author: cazfi
Date: Wed Dec 10 22:32:32 2014
New Revision: 27250

URL: http://svn.gna.org/viewcvs/freeciv?rev=27250&view=rev
Log:
While loading savegame with "Experimental" level AI to a build where it's not 
supported,
convert it to "Hard".

See patch #5500

Modified:
    trunk/server/savegame2.c

Modified: trunk/server/savegame2.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savegame2.c?rev=27250&r1=27249&r2=27250&view=diff
==============================================================================
--- trunk/server/savegame2.c    (original)
+++ trunk/server/savegame2.c    Wed Dec 10 22:32:32 2014
@@ -3787,6 +3787,12 @@
                                      "player%d.ai.level", plrno);
   if (level != NULL) {
     plr->ai_common.skill_level = ai_level_by_name(level, fc_strcasecmp);
+
+    /* In builds where level "Experimental" is not supported, convert it to 
"Hard" */
+    if (!ai_level_is_valid(plr->ai_common.skill_level)
+        && !fc_strcasecmp(level, "Experimental")) {
+      plr->ai_common.skill_level = AI_LEVEL_HARD;
+    }
   } else {
     plr->ai_common.skill_level = ai_level_invalid();
   }


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

Reply via email to