mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use BannerIndex::UnderlyingType for iterations
This commit is contained in:
parent
e201c3b7fd
commit
e6187a0af4
|
@ -972,7 +972,7 @@ namespace OpenRCT2
|
|||
cs.Write(static_cast<uint32_t>(numBanners));
|
||||
|
||||
[[maybe_unused]] size_t numWritten = 0;
|
||||
for (uint16_t i = 0; i < MAX_BANNERS; i++)
|
||||
for (BannerIndex::UnderlyingType i = 0; i < MAX_BANNERS; i++)
|
||||
{
|
||||
auto banner = GetBanner(BannerIndex::FromUnderlying(i));
|
||||
if (banner != nullptr)
|
||||
|
@ -990,7 +990,7 @@ namespace OpenRCT2
|
|||
{
|
||||
std::vector<Banner> banners;
|
||||
cs.ReadWriteVector(banners, [version, &cs](Banner& banner) { ReadWriteBanner(version, cs, banner); });
|
||||
for (uint16_t i = 0; i < banners.size(); i++)
|
||||
for (BannerIndex::UnderlyingType i = 0; i < banners.size(); i++)
|
||||
{
|
||||
auto bannerIndex = BannerIndex::FromUnderlying(i);
|
||||
auto banner = GetOrCreateBanner(bannerIndex);
|
||||
|
|
|
@ -113,7 +113,7 @@ static ride_id_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords)
|
|||
|
||||
static BannerIndex BannerGetNewIndex()
|
||||
{
|
||||
for (uint16_t bannerIndex = 0; bannerIndex < MAX_BANNERS; bannerIndex++)
|
||||
for (BannerIndex::UnderlyingType bannerIndex = 0; bannerIndex < MAX_BANNERS; bannerIndex++)
|
||||
{
|
||||
if (bannerIndex < _banners.size())
|
||||
{
|
||||
|
@ -238,7 +238,7 @@ ride_id_t banner_get_closest_ride_index(const CoordsXYZ& mapPos)
|
|||
|
||||
void banner_reset_broken_index()
|
||||
{
|
||||
for (uint16_t index = 0; index < _banners.size(); index++)
|
||||
for (BannerIndex::UnderlyingType index = 0; index < _banners.size(); index++)
|
||||
{
|
||||
const auto bannerId = BannerIndex::FromUnderlying(index);
|
||||
auto tileElement = banner_get_tile_element(bannerId);
|
||||
|
|
Loading…
Reference in New Issue