summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-06-05 21:19:38 +0000
committerfrosch <frosch@openttd.org>2009-06-05 21:19:38 +0000
commit4554c79b54a7f785370a2fd234af19dc70886bef (patch)
tree3e7916db39d547039e9aa37bd8ed0455853f4977 /src/yapf
parentad5f01819598ccf787d5f146d49dbccf16d6f947 (diff)
downloadopenttd-4554c79b54a7f785370a2fd234af19dc70886bef.tar.xz
(svn r16521) -Fix [FS#2946] (r13945): Do not access 'compatible_railtypes' for road vehicles. (causing invalid reads since r16391/16392)
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/follow_track.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/yapf/follow_track.hpp b/src/yapf/follow_track.hpp
index f670ac82d..93c4db633 100644
--- a/src/yapf/follow_track.hpp
+++ b/src/yapf/follow_track.hpp
@@ -55,7 +55,7 @@ struct CFollowTrackT
{
assert(!IsRailTT() || (v != NULL && v->type == VEH_TRAIN));
m_veh = v;
- Init(v != NULL ? v->owner : INVALID_OWNER, railtype_override == INVALID_RAILTYPES ? ((const Train *)v)->compatible_railtypes : railtype_override, pPerf);
+ Init(v != NULL ? v->owner : INVALID_OWNER, IsRailTT() && railtype_override == INVALID_RAILTYPES ? ((const Train *)v)->compatible_railtypes : railtype_override, pPerf);
}
FORCEINLINE void Init(Owner o, RailTypes railtype_override, CPerformanceTimer *pPerf)