1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Remove ObjectType++ operator, ensure ObjectTypes size

This commit is contained in:
Hielke Morsink
2022-06-30 23:13:40 +02:00
committed by GitHub
parent 43562a6899
commit 8e509d9669
4 changed files with 9 additions and 14 deletions

View File

@@ -1273,18 +1273,19 @@ static int32_t cc_object_count(InteractiveConsole& console, [[maybe_unused]] con
"Paths", "Path Additions", "Scenery groups", "Park entrances", "Water",
};
for (ObjectType i = ObjectType::Ride; i < ObjectType::ScenarioText; i++)
for (auto objectType : ObjectTypes)
{
int32_t entryGroupIndex = 0;
for (; entryGroupIndex < object_entry_group_counts[EnumValue(i)]; entryGroupIndex++)
for (; entryGroupIndex < object_entry_group_counts[EnumValue(objectType)]; entryGroupIndex++)
{
if (object_entry_get_chunk(i, entryGroupIndex) == nullptr)
if (object_entry_get_chunk(objectType, entryGroupIndex) == nullptr)
{
break;
}
}
console.WriteFormatLine(
"%s: %d/%d", object_type_names[EnumValue(i)], entryGroupIndex, object_entry_group_counts[EnumValue(i)]);
"%s: %d/%d", object_type_names[EnumValue(objectType)], entryGroupIndex,
object_entry_group_counts[EnumValue(objectType)]);
}
return 0;