diff options
author | frosch <frosch@openttd.org> | 2009-06-05 21:19:38 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-06-05 21:19:38 +0000 |
commit | 4554c79b54a7f785370a2fd234af19dc70886bef (patch) | |
tree | 3e7916db39d547039e9aa37bd8ed0455853f4977 /src/yapf/follow_track.hpp | |
parent | ad5f01819598ccf787d5f146d49dbccf16d6f947 (diff) | |
download | openttd-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/follow_track.hpp')
-rw-r--r-- | src/yapf/follow_track.hpp | 2 |
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) |