Codechange: Store objectspecs in std::vector instead of flat array.

This commit is contained in:
Peter Nelson
2022-11-06 19:21:03 +00:00
committed by PeterN
parent 93197f58b7
commit 1f46f080f0
7 changed files with 26 additions and 16 deletions

View File

@@ -312,10 +312,11 @@ void ObjectOverrideManager::SetEntitySpec(ObjectSpec *spec)
return;
}
extern ObjectSpec _object_specs[NUM_OBJECTS];
extern std::vector<ObjectSpec> _object_specs;
/* Now that we know we can use the given id, copy the spec to its final destination. */
memcpy(&_object_specs[type], spec, sizeof(*spec));
if (type >= _object_specs.size()) _object_specs.resize(type + 1);
_object_specs[type] = *spec;
}
/**