Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2005:
[Freeciv-Dev] Re: (PR#11682) version 2.0.0 - loading a saved game
Home

[Freeciv-Dev] Re: (PR#11682) version 2.0.0 - loading a saved game

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: vickramghumman@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11682) version 2.0.0 - loading a saved game
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 1 Jan 2005 13:31:08 -0800
Reply-to: bugs@xxxxxxxxxxx

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

On Fri, 24 Dec 2004, Vickram Ghumman wrote:
> When I try to load a saved game the server crashed.
> the error generated starts with the sentence..
>
>   illegal alliance structure detected...

Thanks for the bug report. The problem lies in trying to bounce units off
illegal stacks before the game is done loading. The attached patch fixes
this.

  - Per

Index: server/savegame.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/savegame.c,v
retrieving revision 1.197.2.10
diff -u -r1.197.2.10 savegame.c
--- server/savegame.c   15 Dec 2004 00:15:43 -0000      1.197.2.10
+++ server/savegame.c   1 Jan 2005 21:29:22 -0000
@@ -1884,7 +1884,6 @@
               plr->name, aplayer->name);
       plr->diplstates[aplayer->player_no].type = DS_PEACE;
       aplayer->diplstates[plr->player_no].type = DS_PEACE;
-      resolve_unit_stacks(plr, aplayer, FALSE);
     }
   } players_iterate_end;
 
@@ -3546,6 +3545,13 @@
     } unit_list_iterate_safe_end;
   } players_iterate_end;
 
+  /* Fix stacking issues */
+  players_iterate(pplayer) {
+    players_iterate(aplayer) {
+      resolve_unit_stacks(pplayer, aplayer, TRUE);
+    } players_iterate_end;
+  } players_iterate_end;
+
   players_iterate(pplayer) {
     calc_civ_score(pplayer);
   } players_iterate_end;

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