Codechange: Store objectspecs in std::vector instead of flat array.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
/* static */ bool ScriptObjectType::IsValidObjectType(ObjectType object_type)
|
||||
{
|
||||
if (object_type >= NUM_OBJECTS) return false;
|
||||
if (object_type >= ObjectSpec::Count()) return false;
|
||||
return ObjectSpec::Get(object_type)->IsEverAvailable();
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
ScriptObjectTypeList::ScriptObjectTypeList()
|
||||
{
|
||||
for (int i = 0; i < NUM_OBJECTS; i++) {
|
||||
for (int i = 0; i < ObjectSpec::Count(); i++) {
|
||||
const ObjectSpec *spec = ObjectSpec::Get(i);
|
||||
if (!spec->IsEverAvailable()) continue;
|
||||
this->AddItem(i);
|
||||
|
Reference in New Issue
Block a user