Mercurial > hg > openttd
changeset 12108:5346f9206c26 draft
(svn r16521) -Fix [FS#2946] (r13945): Do not access 'compatible_railtypes' for road vehicles. (causing invalid reads since r16391/16392)
author | frosch <frosch@openttd.org> |
---|---|
date | Fri, 05 Jun 2009 21:19:38 +0000 |
parents | 054e0ccb46dc |
children | f48988eda1a7 |
files | src/yapf/follow_track.hpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/yapf/follow_track.hpp +++ b/src/yapf/follow_track.hpp @@ -55,7 +55,7 @@ { 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)