Complete.Org: Mailing Lists: Archives: freeciv-dev: January 1999:
Re: [Freeciv-Dev] helpdata.txt patch - terrain alterations
Home

Re: [Freeciv-Dev] helpdata.txt patch - terrain alterations

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] helpdata.txt patch - terrain alterations
From: Greg Wooledge <wooledge@xxxxxxxxxxx>
Date: Mon, 18 Jan 1999 19:04:50 -0500

Lalo Martins (lalo@xxxxxxxxxx) wrote:

> I don't like it... don't you think it would look better if you
> split it? Ie
> 
> #Terrain Alterations
> # Irrigation
> # Mine
> # Road
> # Railroad
> # Fortress

That's certainly feasible, but each section would be awfully small.
Does anyone else think this should be done?

> > + - Units expend no movement points when moving along a railroad.
> > +   You may ride a railroad indefinitely.
> 
> Uh, that's not correct. Movement costs are drastically
> decreased, but not to zero. I have to check the sources to see
> the exact effect.

map.c, reset_move_costs():

    else if ((tile0->special & tile1->special) & S_RAILROAD) c = 0;
    else if ((tile0->special & tile1->special) & S_ROAD) c = 1;
    else if (tile0->terrain == T_RIVER && tile1->terrain == T_RIVER) c = 1;
    else c = get_tile_type(tile1->terrain)->movement_cost*3;

This code, or something much like it, appears twice in reset_move_costs()
and once in initialize_move_costs().  Should it be consolidated?

map.c, tile_move_cost():

  if( (t1->special&S_RAILROAD) && (t2->special&S_RAILROAD) )
    return 0;
  if(unit_flag(punit->type, F_IGTER)) 
    return 1;
  if( (t1->special&S_ROAD) && (t2->special&S_ROAD) )
    return 1;
  if( (t1->terrain==T_RIVER) && (t2->terrain==T_RIVER) )
    return 1;
  return(get_tile_type(t2->terrain)->movement_cost*3);

Again, there appears to be a bit of redundancy....

-- 
Greg Wooledge                    | Distributed.NET http://www.distributed.net/
wooledge@xxxxxxxxxxx             | because a CPU is a terrible thing to waste.
http://www.kellnet.com/wooledge/ |


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