1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-16 11:09:11 +00:00

(svn r2281) - Fix: [ 1115204 ] [NPF] When pressing the goto depot button, trains will now also look behind it if there is no depot in front. If so, the train reverses immediately. This also work anywhere, not just at stations.

- Add: [NPF] Reversing inside of depots now has a penalty. It also applies to trains only, other vehicles shouldn't bother reversing.
- Fix: [NPF] When checking whether to reverse a train, the trackdir of the first loc was used instead of the last vehicle as a starting node for pathfindig.
	This might have caused some trains not reversing when they should have (or vice versa). Typo introduced when converting to GetVehicleTrackdir() in r2256.
- CodeChange: [NPF] Removed duplicate code by letting NPFRouteTjoStationOrTile() call NPFRouteToStationOrTileTwoWay().
- Add: [NPF] NPFRouteToDepotBreadthFirstTwoWay() to find a depot while also looking backwards.
- Add: It is now possibly to specify a path cost for aystar starting nodes.
This commit is contained in:
matthijs
2005-05-07 22:00:36 +00:00
parent f2bc27718a
commit 0e08878a68
8 changed files with 96 additions and 38 deletions

View File

@@ -212,6 +212,7 @@ 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 */
@@ -452,7 +453,8 @@ VARDEF byte _vehicle_design_names;
/* tunnelbridge */
#define MAX_BRIDGES 13
/* For new pathfinding. Define here so it is globally available */
/* For new pathfinding. Define here so it is globally available without having
* to include npf.h */
#define NPF_TILE_LENGTH 100
/* Autoreplace vehicle stuff*/