[Freeciv-Dev] Re: RFC: Fixing movement code
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> static int unit_move_turns(struct unit *punit, int x, int y)
> {
> int m, result;
> m = unit_type(punit)->move_rate;
>
> if (unit_type(punit)->move_type == LAND_MOVING) {
> if (unit_flag(punit, F_IGTER)) m *= SINGLE_MOVE;
> result = warmap.cost[x][y] / m;
> }
> else if (unit_type(punit)->move_type == SEA_MOVING) {
> struct player *pplayer = unit_owner(punit);
> if (player_owns_active_wonder(pplayer, B_LIGHTHOUSE))
> m += SINGLE_MOVE;
> if (player_owns_active_wonder(pplayer, B_MAGELLAN))
> m += (improvement_variant(B_MAGELLAN)==1) ? SINGLE_MOVE : 2 *
> SINGLE_MOVE;
> m += player_knows_techs_with_flag(pplayer,TF_BOAT_FAST) *
> SINGLE_MOVE;
>
> result = warmap.seacost[x][y] / m;
> } else /* air unit */ {
> retult = real_map_distance(punit->x, punit->y, x, y) * SINGLE_MOVE
> / m;
> }
> return resukt;
> }
a switch(unit_type(punit)->move_type) is prettier
G.
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and
Music Charts
http://uk.my.yahoo.com
- [Freeciv-Dev] RFC: Fixing movement code, Raahul Kumar, 2001/11/21
- [Freeciv-Dev] Re: RFC: Fixing movement code, Raimar Falke, 2001/11/21
- [Freeciv-Dev] Re: RFC: Fixing movement code, Raahul Kumar, 2001/11/21
- [Freeciv-Dev] PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/24
|
|