From 9395624e5f36f471ff40c8dcf285301f5fac6fbe Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 22 Oct 2024 21:25:52 +0200 Subject: [PATCH] Write SoundGens after their creatures --- apps/opencs/model/doc/saving.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/opencs/model/doc/saving.cpp b/apps/opencs/model/doc/saving.cpp index bb5f9cc696..868429f96c 100644 --- a/apps/opencs/model/doc/saving.cpp +++ b/apps/opencs/model/doc/saving.cpp @@ -97,9 +97,6 @@ CSMDoc::Saving::Saving(Document& document, const std::filesystem::path& projectP appendStage( new WriteCollectionStage>(mDocument.getData().getBodyParts(), mState)); - appendStage(new WriteCollectionStage>( - mDocument.getData().getSoundGens(), mState)); - appendStage(new WriteCollectionStage>( mDocument.getData().getMagicEffects(), mState)); @@ -108,6 +105,10 @@ CSMDoc::Saving::Saving(Document& document, const std::filesystem::path& projectP appendStage(new WriteRefIdCollectionStage(mDocument, mState)); + // Can reference creatures so needs to load after them for TESCS compatibility + appendStage(new WriteCollectionStage>( + mDocument.getData().getSoundGens(), mState)); + appendStage(new CollectionReferencesStage(mDocument, mState)); appendStage(new WriteCellCollectionStage(mDocument, mState));