Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] Re: The missing patch
Home

[Freeciv-Dev] Re: The missing patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mateusz stefek <matusik_s@xxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: The missing patch
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Nov 2001 17:18:59 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Nov 12, 2001 at 08:30:22PM +0100, mateusz stefek wrote:
> For ai cross-country-rail

> --- freeorig/server/settlers.c        Mon Nov 12 09:03:41 2001
> +++ freeciv/server/settlers.c Mon Nov 12 10:27:43 2001
> @@ -48,6 +48,7 @@
>  static int is_already_assigned(struct unit *myunit, struct player *pplayer, 
>                              int x, int y);
>  
> +static int cross_country_rail(struct unit* punit, struct player* pplayer);
>  
>  /**************************************************************************
>  ...
> @@ -1306,6 +1307,12 @@
>        gy = ny;
>      }
>    }
> +  /* if we don't want to build a city,
> +   * build the railroad
> +   */

> +  if (pplayer->ai.control && best_act != ACTIVITY_UNKNOWN)

What do you think about:

  if (pplayer->ai.control && unit_flag(punit, F_SETTLERS) && best_act == 
ACTIVITY_IDLE && gx==-1 and gy==-1)

Can the condition may also put here?

  } else {
    /* This line makes non-AI autosettlers go off auto when they run
       out of squares to improve. I would like keep them on, prepared for
       future pollution and warming, but there wasn't consensus to do so. */
    punit->ai.control=0;
  }

Nevertheless I think that this whole method needs a cleanup. This
starts with:

  int best_act = 0;             /* ACTIVITY_ of best target so far */

which should be

  enum unit_activity best_act = ACTIVITY_IDLE;

and ends with this useless else case:

  } else if (pplayer->ai.control) { /* settler has no purpose */
    /* possibly add Gilligan's Island here */
    ;
  }

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I haven't lost my mind - it's backed up on tape somewhere."


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