1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 03:12:41 +01:00

Codechange: explicitly initialise Company member variables

This commit is contained in:
Rubidium
2025-02-17 20:34:07 +01:00
committed by rubidium42
parent 8b7c92dfe3
commit 24a7cde9cc
9 changed files with 79 additions and 86 deletions

View File

@@ -496,8 +496,8 @@ void DrawNewObjectTileInGUI(int x, int y, const ObjectSpec *spec, uint8_t view)
if (Company::IsValidID(_local_company)) {
/* Get the colours of our company! */
if (spec->flags.Test(ObjectFlag::Uses2CC)) {
const Livery *l = Company::Get(_local_company)->livery;
palette = SPR_2CCMAP_BASE + l->colour1 + l->colour2 * 16;
const Livery &l = Company::Get(_local_company)->livery[0];
palette = SPR_2CCMAP_BASE + l.colour1 + l.colour2 * 16;
} else {
palette = COMPANY_SPRITE_COLOUR(_local_company);
}