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: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: The missing patch
From: "mateusz stefek" <matusik_s@xxxxx>
Date: Tue, 20 Nov 2001 08:26:43 +0100

>> For ai cross-country-rail
>
>n the function
>
>static int cross_country_rail(struct unit* punit, struct player* pplayer)
>
>int d = warmap.cost[pcity->x][pcity->y];
>    if (d == 0) is_connected = 1;else
>
>You cannot assume railroad_move cost is always going to equal 0.
>Make the test if (d == railroad_move_cost). In fact, for a non zero
>movecost this function would have to be rewritten. You need a check
>that counts the number of tiles between pctiy x and y. Multiply the
>result by railroad_move_cost. If d = the result then is connected.
>
That isn't always right way (something could be smaller than MOVE_COST_RAIL)

What about adding
+#if MOVE_COST_RAIL == 0
everywhere cross_country_rail is used? (4 places)
Or should I write something more complicated but prettier?

------
mateusz stefek




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