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:
@@ -672,11 +672,11 @@ CommandCost CmdSetGroupLivery(DoCommandFlag flags, GroupID group_id, bool primar
|
||||
if (flags & DC_EXEC) {
|
||||
if (primary) {
|
||||
SB(g->livery.in_use, 0, 1, colour != INVALID_COLOUR);
|
||||
if (colour == INVALID_COLOUR) colour = (Colours)GetParentLivery(g)->colour1;
|
||||
if (colour == INVALID_COLOUR) colour = GetParentLivery(g)->colour1;
|
||||
g->livery.colour1 = colour;
|
||||
} else {
|
||||
SB(g->livery.in_use, 1, 1, colour != INVALID_COLOUR);
|
||||
if (colour == INVALID_COLOUR) colour = (Colours)GetParentLivery(g)->colour2;
|
||||
if (colour == INVALID_COLOUR) colour = GetParentLivery(g)->colour2;
|
||||
g->livery.colour2 = colour;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user