1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-25 15:39:09 +00:00

Codechange: Add AssignBit function to assign the value of a single bit (#12934)

* Codechange: Add AssignBit function to assign the value of a single bit

* Codechange: Replace various uses of SB with AssignBit

* Codechange: Replace various uses of SB with a constant with SetBit
This commit is contained in:
Jonathan G Rennison
2024-09-10 13:36:58 +01:00
committed by GitHub
parent 27efa57b7b
commit e477706bf5
18 changed files with 48 additions and 29 deletions

View File

@@ -674,11 +674,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);
AssignBit(g->livery.in_use, 0, colour != INVALID_COLOUR);
if (colour == INVALID_COLOUR) colour = GetParentLivery(g)->colour1;
g->livery.colour1 = colour;
} else {
SB(g->livery.in_use, 1, 1, colour != INVALID_COLOUR);
AssignBit(g->livery.in_use, 1, colour != INVALID_COLOUR);
if (colour == INVALID_COLOUR) colour = GetParentLivery(g)->colour2;
g->livery.colour2 = colour;
}