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

@@ -305,7 +305,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(byte local_id, uint32_t grf
switch (variable) {
/* Relative position. */
case 0x40: {
uint offset = this->tile - this->obj->location.tile;
TileIndex offset = this->tile - this->obj->location.tile;
uint offset_x = TileX(offset);
uint offset_y = TileY(offset);
return offset_y << 20 | offset_x << 16 | offset_y << 8 | offset_x;