Author: cazfi
Date: Sun Sep 13 14:27:32 2015
New Revision: 29874

URL: http://svn.gna.org/viewcvs/freeciv?rev=29874&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:
    branches/S2_6/server/savecompat.c

Modified: branches/S2_6/server/savecompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/savecompat.c?rev=29874&r1=29873&r2=29874&view=diff
==============================================================================
--- branches/S2_6/server/savecompat.c   (original)
+++ branches/S2_6/server/savecompat.c   Sun Sep 13 14:27:32 2015
@@ -486,7 +486,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. */
@@ -775,11 +774,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,
@@ -974,27 +973,6 @@
       }
     }
     secfile_insert_int(loading->file, count, "research.count");
-  }
-
-  nplayers = secfile_lookup_int_default(loading->file, 0, "players.nplayers");
-
-  for (plrno = 0; plrno < nplayers; plrno++) {
-    /* Add 'anonymous' qualifiers for user names */
-    if (secfile_entry_lookup(loading->file, "player%d.anon_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) {
-      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);
-    }
   }
 }
 


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

Reply via email to