Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10759) pubserver crash
Home

[Freeciv-Dev] (PR#10759) pubserver crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: michael@xxxxxxxxx
Subject: [Freeciv-Dev] (PR#10759) pubserver crash
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Oct 2004 11:38:44 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10759 >

Can be reproduced with this autogame in S2_0.  Problem is
min_goodies_per_player is 0.

The attached patch avoids the crash but then we get

0: The server appears to have gotten into an infinite loop in the
allocation of starting positions, and will abort.

jason



Index: server/generator/startpos.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/generator/startpos.c,v
retrieving revision 1.5
diff -u -r1.5 startpos.c
--- server/generator/startpos.c 20 Oct 2004 04:20:02 -0000      1.5
+++ server/generator/startpos.c 27 Oct 2004 18:18:13 -0000
@@ -311,7 +311,7 @@
 
       if (mode == MT_VARIABLE && to_place > 0) {
        islands[nr].starters = MAX(1, islands[nr].goodies 
-                                  / min_goodies_per_player);
+                                  / MAX(min_goodies_per_player, 1));
        to_place -= islands[nr].total = islands[nr].starters;
       }
     }

set timeout -1
create b

set steepness 0
set wetness 0
set temperature 0

set topology 3
set alltemperate 1

set mapseed 599833218
set gameseed 1098898863

start


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