Author: cazfi
Date: Sun Sep 13 14:27:24 2015
New Revision: 29873

URL: http://svn.gna.org/viewcvs/freeciv?rev=29873&view=rev
Log:
Fixed loading of old savegames without separate fields telling if a player has 
no user
or ranked user assigned.

Reported by Sveinung Kvilhaugsvik <sveinung>

See bug #23871

Modified:
    trunk/server/savecompat.c

Modified: trunk/server/savecompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savecompat.c?rev=29873&r1=29872&r2=29873&view=diff
==============================================================================
--- trunk/server/savecompat.c   (original)
+++ trunk/server/savecompat.c   Sun Sep 13 14:27:24 2015
@@ -526,7 +526,6 @@
         if (!name) {
           continue;
         }
-
         /* In 2.4.x and prior, "killcitizen" listed move types that
          * killed citizens after succesfull attack. Now killcitizen
          * is just boolean and classes affected are defined in ruleset. */
@@ -815,11 +814,11 @@
     /* Add 'anonymous' qualifiers for user names */
     name = secfile_lookup_str_default(loading->file, "", "player%d.username", 
plrno);
     secfile_insert_bool(loading->file, (!strcmp(name, ANON_USER_NAME)),
-                        "player%d.anon_user", plrno);
+                        "player%d.unassigned_user", plrno);
 
     name = secfile_lookup_str_default(loading->file, "", 
"player%d.ranked_username", plrno);
     secfile_insert_bool(loading->file, (!strcmp(name, ANON_USER_NAME)),
-                        "player%d.anon_ranked", plrno);
+                        "player%d.unassigned_ranked", plrno);
 
     /* Convert numeric barbarian type to textual */
     old_barb_type = secfile_lookup_int_default(loading->file, 0,
@@ -1062,20 +1061,20 @@
 
   for (plrno = 0; plrno < nplayers; plrno++) {
     /* Add 'anonymous' qualifiers for user names */
-    if (secfile_entry_lookup(loading->file, "player%d.anon_user", plrno) == 
NULL) {
+    if (secfile_entry_lookup(loading->file, "player%d.unassigned_user", plrno) 
== NULL) {
       const char *name;
 
       name = secfile_lookup_str_default(loading->file, "", 
"player%d.username", plrno);
       secfile_insert_bool(loading->file, (!strcmp(name, ANON_USER_NAME)),
-                          "player%d.anon_user", plrno);
-    }
-
-    if (secfile_entry_lookup(loading->file, "player%d.anon_ranked", plrno) == 
NULL) {
+                          "player%d.unassigned_user", plrno);
+    }
+
+    if (secfile_entry_lookup(loading->file, "player%d.unassigned_ranked", 
plrno) == NULL) {
       const char *name;
 
       name = secfile_lookup_str_default(loading->file, "", 
"player%d.ranked_username", plrno);
       secfile_insert_bool(loading->file, (!strcmp(name, ANON_USER_NAME)),
-                          "player%d.anon_ranked", plrno);
+                          "player%d.unassigned_ranked", plrno);
     }
   }
 }


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

Reply via email to