Fix undefined behaviour when left-shifting negative values by casting to unsigned
This silences warning spam from UndefinedBehaviorSanitizer.
This commit is contained in:
@@ -232,7 +232,7 @@ static inline uint TileY(TileIndex tile)
|
||||
*/
|
||||
static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc)
|
||||
{
|
||||
return (tidc.y << MapLogX()) + tidc.x;
|
||||
return (((uint) tidc.y) << MapLogX()) + tidc.x;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user