mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-25 08:22:17 +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:
@@ -400,7 +400,7 @@ public:
|
||||
SwapPackets(&ge);
|
||||
}
|
||||
if (IsSavegameVersionBefore(SLV_68)) {
|
||||
SB(ge.status, GoodsEntry::GES_ACCEPTANCE, 1, HasBit(_waiting_acceptance, 15));
|
||||
AssignBit(ge.status, GoodsEntry::GES_ACCEPTANCE, HasBit(_waiting_acceptance, 15));
|
||||
if (GB(_waiting_acceptance, 0, 12) != 0) {
|
||||
/* In old versions, enroute_from used 0xFF as INVALID_STATION */
|
||||
StationID source = (IsSavegameVersionBefore(SLV_7) && _cargo_source == 0xFF) ? INVALID_STATION : _cargo_source;
|
||||
@@ -414,7 +414,7 @@ public:
|
||||
/* Don't construct the packet with station here, because that'll fail with old savegames */
|
||||
CargoPacket *cp = new CargoPacket(GB(_waiting_acceptance, 0, 12), _cargo_periods, source, _cargo_source_xy, _cargo_feeder_share);
|
||||
ge.cargo.Append(cp, INVALID_STATION);
|
||||
SB(ge.status, GoodsEntry::GES_RATING, 1, 1);
|
||||
SetBit(ge.status, GoodsEntry::GES_RATING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user