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:
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user