(svn r16451) -Fix (r16449): crash when a spectator (or dedicated server) received news about new engine

This commit is contained in:
smatz 2009-05-27 19:37:27 +00:00
parent 4c9b4f5265
commit 5cd998b7a4
1 changed files with 3 additions and 0 deletions

View File

@ -1406,6 +1406,9 @@ static SpriteID GetEngineColourMap(EngineID engine_type, CompanyID company, Engi
if (map == PAL_NONE) map = twocc ? (SpriteID)SPR_2CCMAP_BASE : (SpriteID)PALETTE_RECOLOUR_START;
/* Spectator has news shown too, but has invalid company ID - as well as dedicated server */
if (!Company::IsValidID(company)) return map;
const Livery *livery = GetEngineLivery(engine_type, company, parent_engine_type, v);
map += livery->colour1;