Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: 'goto' prefers the path via ship (PR#888)
Home

[Freeciv-Dev] Re: 'goto' prefers the path via ship (PR#888)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: 'goto' prefers the path via ship (PR#888)
From: Thue <thue@xxxxxxx>
Date: Mon, 13 Aug 2001 22:49:04 +0200

On Sunday 12 August 2001 15:00, Gregory Berkolaiko wrote:
> probably you are right. so the attached patch (against 1.12.0) does
> the following:
> 1. penalizes (very slightly) movement of the type land->ship->land
> (of 2 equivalent routes it should really take the land only route) 2.
> checks for the movements of the type ship->land_occupied_by_enemy and
> disallows it (unless the unit is Marines)

+         if (map_get_terrain(src_x, src_y) == T_OCEAN) {
+           int base_cost = get_tile_type(pdesttile->terrain)->movement_cost 
* SINGLE_MOVE;
+           move_cost = igter ? MOVE_COST_ROAD : \
+             MIN(base_cost, unit_types[punit->type].move_rate);
+         } else {
+           /* Attempting to make a path through a sea transporter */
+           move_cost = SINGLE_MOVE + MOVE_COST_ROAD; /* Rather arbitrary 
deterrent */
+         }

Should have been

+         move_cost = igter ? MOVE_COST_ROAD :
+           MIN(base_cost, unit_types[punit->type].move_rate);
+
+         if (src_x != x || src_y != y) {
+           /* Attempting to make a path through a sea transporter */
+           move_cost += MOVE_COST_ROAD; /* Rather arbitrary deterrent */
+         }

I think.

-Thue

Attachment: diff
Description: Text Data


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