Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] Re: Civserver upgrade building (PR#1585)
Home

[Freeciv-Dev] Re: Civserver upgrade building (PR#1585)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Civserver upgrade building (PR#1585)
From: Joona Kiiski <freeciv-dev@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jun 2002 22:58:42 +0300

On Mon, Jun 17, 2002 at 12:55:11PM -0700, dspeyer@xxxxxxxxxxx wrote:
> Full_Name: Daniel Speyer
> Version: CVS 
> Distribution: Built from source
> Client: Both (or N/A)
> OS: Gnu/Linux -- Debian woody
> Submission from: (NULL) (12.243.200.32)
> 
> 
> If you develope musketeers before pikemen, your cities will continue to build
> phalanxes.  This can be very annoying.  This patch should fix it (apply to
> freeciv/server/cityturn.c):
> 

This topic has been discussed before. And there are situations when
you might want to build phalanx instead of musketeer (because it is
cheaper). I understand that current behaviour is a bit annoying... But you
can use "change all"-command.

> 
> diff -u cityturn.c.old cityturn.c
> --- cityturn.c.old      Mon Jun 17 15:40:04 2002
> +++ cityturn.c  Mon Jun 17 15:41:09 2002
> @@ -842,13 +842,13 @@
>  **************************************************************************/
>  static Unit_Type_id unit_upgrades_to(struct city *pcity, Unit_Type_id id)
>  {
> -  Unit_Type_id latest_ok = id;
> -
> -  if (!can_build_unit_direct(pcity, id))
> -    return -1;
> -  while(unit_type_exists(id = unit_types[id].obsoleted_by))
> -    if (can_build_unit_direct(pcity, id))
> +  Unit_Type_id latest_ok = -1;
> +  
> +  for(; unit_type_exists(id); id = unit_types[id].obsoleted_by){
> +    if (can_build_unit_direct(pcity, id)){
>        latest_ok = id;
> +    }
> +  }
>  
>    return latest_ok;
>  }
> 
> 
> 

-- 
Joona Kiiski <joona.kiiski@xxxxxx>


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