mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r1964) - Add: [NPF] Added a penalty
This commit is contained in:
parent
6a5495f83c
commit
e7af60594b
5
npf.c
5
npf.c
@ -369,7 +369,10 @@ int32 NPFRailPathCost(AyStar* as, AyStarNode* current, OpenListNode* parent) {
|
|||||||
cost += NPFSlopeCost(current);
|
cost += NPFSlopeCost(current);
|
||||||
|
|
||||||
/* Check for turns */
|
/* Check for turns */
|
||||||
//TODO
|
if (current->direction != parent->path.node.direction)
|
||||||
|
cost += _patches.npf_rail_curve_penalty;
|
||||||
|
//TODO, with realistic acceleration, also the amount of straight track between
|
||||||
|
// curves should be taken into account, as this affects the speed limit.
|
||||||
|
|
||||||
/* Check for occupied track */
|
/* Check for occupied track */
|
||||||
//TODO
|
//TODO
|
||||||
|
@ -949,6 +949,7 @@ const SettingDesc patch_settings[] = {
|
|||||||
*/
|
*/
|
||||||
{"npf_rail_station_penalty", SDT_UINT32, (void*)(1 * NPF_TILE_LENGTH), &_patches.npf_rail_station_penalty, NULL},
|
{"npf_rail_station_penalty", SDT_UINT32, (void*)(1 * NPF_TILE_LENGTH), &_patches.npf_rail_station_penalty, NULL},
|
||||||
{"npf_rail_slope_penalty", SDT_UINT32, (void*)(1 * NPF_TILE_LENGTH), &_patches.npf_rail_slope_penalty, NULL},
|
{"npf_rail_slope_penalty", SDT_UINT32, (void*)(1 * NPF_TILE_LENGTH), &_patches.npf_rail_slope_penalty, NULL},
|
||||||
|
{"npf_rail_curve_penalty", SDT_UINT32, (void*)(1), &_patches.npf_rail_curve_penalty, NULL},
|
||||||
|
|
||||||
{NULL, 0, NULL, NULL, NULL}
|
{NULL, 0, NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -196,6 +196,7 @@ typedef struct Patches {
|
|||||||
uint32 npf_rail_lastred_penalty; /* The penalty for when the last signal is red */
|
uint32 npf_rail_lastred_penalty; /* The penalty for when the last signal is red */
|
||||||
uint32 npf_rail_station_penalty; /* The penalty for station tiles */
|
uint32 npf_rail_station_penalty; /* The penalty for station tiles */
|
||||||
uint32 npf_rail_slope_penalty; /* The penalty for sloping upwards */
|
uint32 npf_rail_slope_penalty; /* The penalty for sloping upwards */
|
||||||
|
uint32 npf_rail_curve_penalty; /* The penalty for curves */
|
||||||
|
|
||||||
bool population_in_label; // Show the population of a town in his label?
|
bool population_in_label; // Show the population of a town in his label?
|
||||||
} Patches;
|
} Patches;
|
||||||
|
Loading…
Reference in New Issue
Block a user