diff --git a/src/openrct2/world/Sprite.cpp b/src/openrct2/world/Sprite.cpp index b3363565e2..2af9e1e6fe 100644 --- a/src/openrct2/world/Sprite.cpp +++ b/src/openrct2/world/Sprite.cpp @@ -55,7 +55,7 @@ constexpr size_t GetSpatialIndexOffset(int32_t x, int32_t y) const auto tileY = std::clamp(y / COORDS_XY_STEP, 0, MAXIMUM_MAP_SIZE_TECHNICAL); const auto index = tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; - if (index >= sizeof(gSpriteSpatialIndex)) + if (index >= std::size(gSpriteSpatialIndex)) { return SPATIAL_INDEX_LOCATION_NULL; }