Codechange: Store objectspecs in std::vector instead of flat array.
(cherry picked from commit 1ae263c5467105820e4d770b3d57d25ba01e22b1)
This commit is contained in:

committed by
Jonathan G Rennison

parent
d34e1bbbc1
commit
74e4556a85
@@ -313,10 +313,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user