Codechange: make no assumptions on how the internals of TileIndex work (#11183)

Basically, avoid ".value", and just cast it to its original type
if you want to retrieve this.
This commit is contained in:
Patric Stout
2023-08-11 14:53:51 +02:00
committed by GitHub
parent 6190f48df0
commit 5fba47b0f7
3 changed files with 5 additions and 5 deletions

View File

@@ -426,7 +426,7 @@ debug_inline static TileIndex TileVirtXY(uint x, uint y)
*/
debug_inline static uint TileX(TileIndex tile)
{
return tile.value & Map::MaxX();
return static_cast<uint32_t>(tile) & Map::MaxX();
}
/**
@@ -436,7 +436,7 @@ debug_inline static uint TileX(TileIndex tile)
*/
debug_inline static uint TileY(TileIndex tile)
{
return tile.value >> Map::LogX();
return static_cast<uint32_t>(tile) >> Map::LogX();
}
/**