1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

do not emplace_back to our mLandTextures; instead use the heavy handed resize to be explicit about what we intend to do; resolves issue found here: https://github.com/OpenMW/openmw/pull/3220#issuecomment-964650167

This commit is contained in:
Bret Curtis 2021-11-12 11:53:21 +01:00
parent 5afd6b0e46
commit 700bace24c
2 changed files with 2 additions and 3 deletions

View File

@ -153,7 +153,7 @@ void ESMStore::load(ESM::ESMReader &esm, Loading::Listener* listener)
// Land texture loading needs to use a separate internal store for each plugin.
// We set the number of plugins here so we can properly verify if valid plugin
// indices are being passed to the LandTexture Store retrieval methods.
mLandTextures.addPlugin();
mLandTextures.resize(esm.getIndex()+1);
// Loop through all records
while(esm.hasMoreRecs())

View File

@ -222,8 +222,7 @@ namespace MWWorld
const ESM::LandTexture *search(size_t index, size_t plugin) const;
const ESM::LandTexture *find(size_t index, size_t plugin) const;
/// Resize the internal store to hold another plugin.
void addPlugin() { mStatic.emplace_back(); }
void resize(size_t num) { mStatic.resize(num); }
size_t getSize() const override;
size_t getSize(size_t plugin) const;