Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] (PR#13489) bug in old_impr_type_id (savegame compatibility
Home

[Freeciv-Dev] (PR#13489) bug in old_impr_type_id (savegame compatibility

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#13489) bug in old_impr_type_id (savegame compatibility code for 2.0)
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Mon, 18 Jul 2005 23:42:40 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13489 >

> [jdorje - Tue Jul 19 02:35:14 2005]:
> 
> static int old_impr_type_id(Impr_Type_id type)
> {
>   int i;
> 
>   for (i = 0; i < ARRAY_SIZE(old_impr_types); i++) {
>     if (mystrcasecmp(unit_name_orig(type), old_impr_types[i]) == 0) {
>       return i;
>     }
>   }
> 
>   /* It's a new improvement. Savegame cannot be forward compatible so
we can
>    * return anything */
>   return type;
> }
> 
> 
> ...
> 
> 
> Shouldn't this be impr_name_orig?  Mateusz?  This affects 2.0 and the
> dev branch.
> 
> -jason
> 
Of course.
--
mateusz
Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.262
diff -u -r1.262 savegame.c
--- server/savegame.c   14 Jul 2005 19:25:46 -0000      1.262
+++ server/savegame.c   19 Jul 2005 06:42:15 -0000
@@ -1079,7 +1079,8 @@
   int i;
 
   for (i = 0; i < ARRAY_SIZE(old_impr_types); i++) {
-    if (mystrcasecmp(unit_name_orig(type), old_impr_types[i]) == 0) {
+    if (mystrcasecmp(get_improvement_name_orig(type),
+                     old_impr_types[i]) == 0) {
       return i;
     }
   }

[Prev in Thread] Current Thread [Next in Thread]