Skip to content

Commit 51579a8

Browse files
committed
Merge branch 'dependenceday' into 'master'
Fix validating ESM3 file dependencies (#8252) Closes #8252 See merge request OpenMW/openmw!4476
2 parents bc02a4a + 11761c5 commit 51579a8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
Bug #8223: Ghosts don't move while spellcasting
224224
Bug #8231: AGOP doesn't like NiCollisionSwitch
225225
Bug #8237: Non-bipedal creatures should *not* use spellcast equip/unequip animations
226+
Bug #8252: Plugin dependencies are not required to be loaded
226227
Feature #1415: Infinite fall failsafe
227228
Feature #2566: Handle NAM9 records for manual cell references
228229
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

apps/openmw/mwworld/esmloader.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ namespace MWWorld
4545
reader->open(filepath);
4646
reader->resolveParentFileIndices(mReaders);
4747

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

0 commit comments

Comments
 (0)