Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2000:
[Freeciv-Dev] Re: changing from settler to building (PR#281)
Home

[Freeciv-Dev] Re: changing from settler to building (PR#281)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: hayden@xxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: changing from settler to building (PR#281)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 12 Mar 2000 01:16:01 +1100 (EST)

On Tue, 29 Feb 2000, Mark Hayden <hayden@xxxxxxxxxxxxxx> wrote:

> Version: 1.10
> Distribution: Built from source
> Client: Both (or N/A)
> OS: RedHat Linux
> 
> If I finish building a settler in a size 1 city before the city
> grows to size 2, I can change the settler construction to
> building without paying the 50% cost you normally get for making
> that kind of change.

Thanks; here is a fix (already commited to cvs).

A remaining oddity is that if you "buy" the Settler
to completion (but don't build it due to size 1),
then on later turns you can change your production
even though normally you can't change after buying.
Not sure how or whether to fix this though...

-- David

--- freeciv-cvs/server/cityturn.c       Fri Feb 11 11:55:04 2000
+++ fc-adv/server/cityturn.c    Sun Mar 12 00:53:01 2000
@@ -1275,7 +1275,6 @@
      * that 'contains' 1 (or more) pop -- sjolie
      */
     if(pcity->shield_stock>=unit_value(pcity->currently_building)) {
-      pcity->turn_last_built = game.year;
       if (unit_flag(pcity->currently_building, F_CITIES)) {
        if (pcity->size==1) {
 
@@ -1294,6 +1293,9 @@
        pcity->size--;
        city_auto_remove_worker(pcity);
       }
+      
+      pcity->turn_last_built = game.year;
+      /* don't update turn_last_built if we returned above for size==1 */
 
       create_unit(pplayer, pcity->x, pcity->y, pcity->currently_building,
                  do_make_unit_veteran(pcity, pcity->currently_building), 

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