summaryrefslogtreecommitdiff
path: root/src/pathfinder
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-12-14 21:33:53 +0000
committerterkhen <terkhen@openttd.org>2010-12-14 21:33:53 +0000
commit48b7916458de4b2cdbc226a4a6ab078db4c77e73 (patch)
treec3a49ca7a91890042ca56765574bc40a54c15f96 /src/pathfinder
parenta93944e765776c6e9a2bd556457cd93748068da6 (diff)
downloadopenttd-48b7916458de4b2cdbc226a4a6ab078db4c77e73.tar.xz
(svn r21521) -Codechange: Unify some cached values that were present in both road vehicles and trains.
Diffstat (limited to 'src/pathfinder')
-rw-r--r--src/pathfinder/yapf/yapf_costrail.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp
index 53f7f60af..5c445843a 100644
--- a/src/pathfinder/yapf/yapf_costrail.hpp
+++ b/src/pathfinder/yapf/yapf_costrail.hpp
@@ -258,8 +258,8 @@ public:
const Train *v = Yapf().GetVehicle();
assert(v != NULL);
assert(v->type == VEH_TRAIN);
- assert(v->tcache.cached_total_length != 0);
- int missing_platform_length = CeilDiv(v->tcache.cached_total_length, TILE_SIZE) - platform_length;
+ assert(v->gcache.cached_total_length != 0);
+ int missing_platform_length = CeilDiv(v->gcache.cached_total_length, TILE_SIZE) - platform_length;
if (missing_platform_length < 0) {
/* apply penalty for longer platform than needed */
cost += Yapf().PfGetSettings().rail_longer_platform_penalty + Yapf().PfGetSettings().rail_longer_platform_per_tile_penalty * -missing_platform_length;