forked from mirror/OpenTTD
Codechange: Store Colours in Colours type. (#11625)
This reduces casts, some magic numbers, and introduces a bit of type-safety.
This commit is contained in:
@@ -2463,7 +2463,7 @@ bool AfterLoadGame()
|
||||
if (IsSavegameVersionBefore(SLV_148)) {
|
||||
for (Object *o : Object::Iterate()) {
|
||||
Owner owner = GetTileOwner(o->location.tile);
|
||||
o->colour = (owner == OWNER_NONE) ? Random() & 0xF : Company::Get(owner)->livery->colour1;
|
||||
o->colour = (owner == OWNER_NONE) ? static_cast<Colours>(GB(Random(), 0, 4)) : Company::Get(owner)->livery->colour1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user