Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] (PR#6942) bug with fixed starting positions
Home

[Freeciv-Dev] (PR#6942) bug with fixed starting positions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6942) bug with fixed starting positions
From: "Eugeny Korekin" <az@xxxxxx>
Date: Mon, 24 Nov 2003 23:06:08 -0800
Reply-to: rt@xxxxxxxxxxx

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

There is a bug with fixed starting position in CVS as well as in
1.4.1beta2 and other versions of freeciv.
Code at lines 161-167 of server/gamehand.c does not what it
supposed to do. It can shuffle starting position for 1 player
several times.

swap_map_positions(&map.start_positions[start_pos[pplayer->player_no]],
             &map.start_positions[pplayer->player_no]);

As an simple example, if there is only 2 nations in ruleset and 
start_position[0]==1, start_position[1]==0, that code swap values
2 times, first time for player 0, and second for player 1, so after
iterating all players we have the same starting positions as before
iteration.

Here is a sample patch, which can be used to fix that bug.

Attachment: freeciv-fixedpos.diff
Description: Binary data


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