Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] (PR#7107) Units move before game_advance_year
Home

[Freeciv-Dev] (PR#7107) Units move before game_advance_year

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7107) Units move before game_advance_year
From: "Michael Kirzinger" <mjk3@xxxxxxxxxxxxxxx>
Date: Tue, 16 Dec 2003 16:43:34 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [ali - Tue Dec 16 21:01:57 2003]:
> 
> On Tue, 16 Dec 2003 11:31:29 -0800 Michael Kirzinger wrote:
> 
> > I'm not sure if this has been brought up before, but any player
> > controlled unit set to ai control moves before the turn is advanced.
> > This is due to the fact that the unit move points are restored and then
> > are moved for the next turn, during end_turn (in srv_main.c), before the
> > turn counter is increased.
> > 
> > One problem that this can cause is that cities from huts found by units
> > on autoexplore/goto receive an incorrect value of one turn earlier for
> > the turn they are founded.
> 
> So the founding date is off by one? If that's so, both the problem
> and your solution patch should apply to PR#6941 Mission Orders,
> assuming that patch will be executed in server as I currently
> advocate.
> 
> Could you spot any other potential problems? As far as I could
> see, it would only matter if someone implemented date-related
> terrain alterations for some reason.
> 

The founding date ends up being one turn earlier than it should be. In
the mission orders patch, the same would apply for engineers on a build
city mission, when they move an odd number of spaces (ie, on the last
turn of their mission, their move points are move 1 space and then build). 

This takes place during the unit end of turn activities in end_turn
(referring it to as end of turn activities seems incorrect to me, as it
restores the unit move points and then does the moves for the next turn
if set to goto/auto*). The same fix should work for both cases, since
the city is being founded in the unit end of turn activities.

I can't see any other problems right now, but I just started looking at
the server code a few days ago. Is there anyone more familiar with the
server code who can explain what potential problems could be (if any) by
moving the unit end of turn activities (which fixes the problem) to
after game_advance_year?

-Michael


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