Change: Expose ObjectSpec vector to simplify iteration.

(cherry picked from commit 51b112139235c66c3adb2c3a75919fc1d3eff9fc)
This commit is contained in:
Peter Nelson
2023-01-15 00:04:53 +00:00
committed by Jonathan G Rennison
parent 74e4556a85
commit c95a3be243
5 changed files with 21 additions and 18 deletions

View File

@@ -15,9 +15,8 @@
ScriptObjectTypeList::ScriptObjectTypeList()
{
for (int i = 0; i < ObjectSpec::Count(); i++) {
const ObjectSpec *spec = ObjectSpec::Get(i);
if (!spec->IsEverAvailable()) continue;
this->AddItem(i);
for (const auto &spec : ObjectSpec::Specs()) {
if (!spec.IsEverAvailable()) continue;
this->AddItem(spec.Index());
}
}