Changeset - r1941:5f5008bdaa63
[Not reviewed]
master
0 3 0
matthijs - 19 years ago 2005-06-16 17:53:40
matthijs@openttd.org
(svn r2447) * Add: [NPF] Penalty for road vehicles making turns.
3 files changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
npf.c
Show inline comments
 
@@ -319,14 +319,16 @@ int32 NPFRoadPathCost(AyStar* as, AyStar
 

	
 
	/* Determine extra costs */
 

	
 
	/* Check for slope */
 
	cost += NPFSlopeCost(current);
 

	
 
	/* Check for turns */
 
	//TODO
 
	/* Check for turns. Road vehicles only really drive diagonal, turns are
 
	 * represented by non-diagonal tracks */
 
	if (!IsDiagonalTrackdir(current->direction))
 
		cost += _patches.npf_road_curve_penalty;
 

	
 
	NPFMarkTile(tile);
 
	DEBUG(npf, 4)("Calculating G for: (%d, %d). Result: %d", TileX(current->tile), TileY(current->tile), cost);
 
	return cost;
 
}
 

	
settings.c
Show inline comments
 
@@ -972,12 +972,14 @@ const SettingDesc patch_settings[] = {
 
	{"npf_rail_depot_reverse_penalty", SDT_UINT32, (void*)(NPF_TILE_LENGTH * 50), &_patches.npf_rail_depot_reverse_penalty, NULL},
 
	{"npf_buoy_penalty",            SDT_UINT32, (void*)(2 * NPF_TILE_LENGTH),   &_patches.npf_buoy_penalty,             NULL},
 
	/* This penalty is applied when a ship makes a turn. It is bigger than the
 
	 * rail curve penalty, since ships (realisticly) have more trouble with
 
	 * making turns */
 
	{"npf_water_curve_penalty",     SDT_UINT32, (void*)(NPF_TILE_LENGTH / 4),   &_patches.npf_water_curve_penalty,      NULL},
 
	/* This is the penalty for road, same as for rail. */
 
	{"npf_road_curve_penalty",      SDT_UINT32, (void*)(1),                     &_patches.npf_road_curve_penalty,       NULL},
 

	
 
	{NULL,                          0,          NULL,                           NULL,                                   NULL}
 
};
 

	
 
static const SettingDesc currency_settings[] = {
 
	{"rate",			SDT_UINT16,										(void*)1,		&_currency_specs[23].rate,			NULL},
variables.h
Show inline comments
 
@@ -212,12 +212,13 @@ typedef struct Patches {
 
	uint32 npf_rail_station_penalty; /* The penalty for station tiles */
 
	uint32 npf_rail_slope_penalty; /* The penalty for sloping upwards */
 
	uint32 npf_rail_curve_penalty; /* The penalty for curves */
 
	uint32 npf_rail_depot_reverse_penalty; /* The penalty for reversing in depots */
 
	uint32 npf_buoy_penalty; /* The penalty for going over (through) a buoy */
 
	uint32 npf_water_curve_penalty; /* The penalty for curves */
 
	uint32 npf_road_curve_penalty; /* The penalty for curves */
 

	
 
	bool population_in_label; // Show the population of a town in his label?
 
} Patches;
 

	
 
VARDEF Patches _patches;
 

	
0 comments (0 inline, 0 general)