Codechange: make explicit when a TileIndex is cast to its basetype (#11190)

This prevents people accidentially assigning a TileIndex to a Date
or any other type they shouldn't.
This commit is contained in:
Patric Stout
2023-08-15 18:12:05 +02:00
committed by GitHub
parent 5d3f7939e2
commit 07730584d7
31 changed files with 120 additions and 105 deletions

View File

@@ -162,7 +162,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(byte param_setID, byte layo
/* Variables available during construction check. */
switch (variable) {
case 0x80: return this->tile;
case 0x80: return static_cast<uint32_t>(this->tile);
case 0x81: return GB(static_cast<uint32_t>(this->tile), 8, 8);
/* Pointer to the town the industry is associated with */
@@ -347,7 +347,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(byte param_setID, byte layo
case 0x7C: return (this->industry->psa != nullptr) ? this->industry->psa->GetValue(parameter) : 0;
/* Industry structure access*/
case 0x80: return this->industry->location.tile;
case 0x80: return static_cast<uint32_t>(this->industry->location.tile);
case 0x81: return GB(static_cast<uint32_t>(this->industry->location.tile), 8, 8);
/* Pointer to the town the industry is associated with */
case 0x82: return this->industry->town->index;