Skip to content

Commit

Permalink
Merge branch 'dependenceday' into 'master'
Browse files Browse the repository at this point in the history
Fix validating ESM3 file dependencies (#8252)

Closes #8252

See merge request OpenMW/openmw!4476
  • Loading branch information
psi29a committed Dec 8, 2024
2 parents bc02a4a + 11761c5 commit 51579a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
Bug #8223: Ghosts don't move while spellcasting
Bug #8231: AGOP doesn't like NiCollisionSwitch
Bug #8237: Non-bipedal creatures should *not* use spellcast equip/unequip animations
Bug #8252: Plugin dependencies are not required to be loaded
Feature #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking
Expand Down
7 changes: 4 additions & 3 deletions apps/openmw/mwworld/esmloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ namespace MWWorld
reader->open(filepath);
reader->resolveParentFileIndices(mReaders);

assert(reader->getGameFiles().size() == reader->getParentFileIndices().size());
for (std::size_t i = 0, n = reader->getParentFileIndices().size(); i < n; ++i)
if (i == static_cast<std::size_t>(reader->getIndex()))
const std::vector<int>& parentIndices = reader->getParentFileIndices();
assert(reader->getGameFiles().size() == parentIndices.size());
for (std::size_t i = 0, n = parentIndices.size(); i < n; ++i)
if (parentIndices[i] == reader->getIndex())
throw std::runtime_error("File " + Files::pathToUnicodeString(reader->getName()) + " asks for parent file "
+ reader->getGameFiles()[i].name
+ ", but it is not available or has been loaded in the wrong order. "
Expand Down

0 comments on commit 51579a8

Please sign in to comment.