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

@@ -97,8 +97,8 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
if (owner == OWNER_NONE) {
o->colour = Random();
} else {
const Livery *l = Company::Get(owner)->livery;
o->colour = l->colour1 + l->colour2 * 16;
const Livery &l = Company::Get(owner)->livery[0];
o->colour = l.colour1 + l.colour2 * 16;
}
/* If the object wants only one colour, then give it that colour. */
@@ -186,8 +186,8 @@ void UpdateObjectColours(const Company *c)
/* Using the object colour callback, so not using company colour. */
if (spec->callback_mask.Test(ObjectCallbackMask::Colour)) continue;
const Livery *l = c->livery;
obj->colour = (spec->flags.Test(ObjectFlag::Uses2CC) ? (l->colour2 * 16) : 0) + l->colour1;
const Livery &l = c->livery[0];
obj->colour = (spec->flags.Test(ObjectFlag::Uses2CC) ? (l.colour2 * 16) : 0) + l.colour1;
}
}