mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r16451) -Fix (r16449): crash when a spectator (or dedicated server) received news about new engine
This commit is contained in:
parent
4c9b4f5265
commit
5cd998b7a4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user