mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-23 21:22:46 +01:00
Codechange: change Source into a class with conversion helpers
A Source is either a CompanyID (Headquarters), IndustryID or TownID. When making those types stronger a lot of casts would be needed, but with these simple helpers the intent is shown more clearly.
This commit is contained in:
@@ -132,7 +132,7 @@ void CargoPacket::Reduce(uint count)
|
||||
/* static */ void CargoPacket::InvalidateAllFrom(Source src)
|
||||
{
|
||||
for (CargoPacket *cp : CargoPacket::Iterate()) {
|
||||
if (cp->source == src) cp->source.id = INVALID_SOURCE;
|
||||
if (cp->source == src) cp->source.MakeInvalid();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user