|
@@ -189,7 +189,7 @@ static uint32 GetClosestObject(TileIndex
|
|
|
for (const Object *o : Object::Iterate()) {
|
|
|
if (o->type != type || o == current) continue;
|
|
|
|
|
|
best_dist = min(best_dist, DistanceManhattan(tile, o->location.tile));
|
|
|
best_dist = std::min(best_dist, DistanceManhattan(tile, o->location.tile));
|
|
|
}
|
|
|
|
|
|
return best_dist;
|
|
@@ -226,7 +226,7 @@ static uint32 GetCountAndDistanceOfClose
|
|
|
/* If the object type is invalid, there is none and the closest is far away. */
|
|
|
if (idx >= NUM_OBJECTS) return 0 | 0xFFFF;
|
|
|
|
|
|
return Object::GetTypeCount(idx) << 16 | min(GetClosestObject(tile, idx, current), 0xFFFF);
|
|
|
return Object::GetTypeCount(idx) << 16 | std::min(GetClosestObject(tile, idx, current), 0xFFFFu);
|
|
|
}
|
|
|
|
|
|
/** Used by the resolver to get values for feature 0F deterministic spritegroups. */
|
|
@@ -301,10 +301,10 @@ static uint32 GetCountAndDistanceOfClose
|
|
|
case 0x44: return GetTileOwner(this->tile);
|
|
|
|
|
|
/* Get town zone and Manhattan distance of closest town */
|
|
|
case 0x45: return GetTownRadiusGroup(t, this->tile) << 16 | min(DistanceManhattan(this->tile, t->xy), 0xFFFF);
|
|
|
case 0x45: return GetTownRadiusGroup(t, this->tile) << 16 | std::min(DistanceManhattan(this->tile, t->xy), 0xFFFFu);
|
|
|
|
|
|
/* Get square of Euclidian distance of closes town */
|
|
|
case 0x46: return GetTownRadiusGroup(t, this->tile) << 16 | min(DistanceSquare(this->tile, t->xy), 0xFFFF);
|
|
|
case 0x46: return GetTownRadiusGroup(t, this->tile) << 16 | std::min(DistanceSquare(this->tile, t->xy), 0xFFFFu);
|
|
|
|
|
|
/* Object colour */
|
|
|
case 0x47: return this->obj->colour;
|