Skip to content

Commit

Permalink
Fix VR inaccurate modcount leading to regeneration
Browse files Browse the repository at this point in the history
VR TESDataHandler compiledFileCollection appears incorrect.
Switched count to use files iteration
  • Loading branch information
alandtse committed Feb 19, 2022
1 parent 77ca26d commit 1150e58
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SeasonManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,16 @@ bool SeasonManager::ShouldRegenerateWinterFormSwap() const

ini.LoadFile(serializedSeasonList);

#ifndef SKYRIMVR
const auto& mods = RE::TESDataHandler::GetSingleton()->compiledFileCollection;
const size_t actualModCount = mods.files.size() + mods.smallFiles.size();

#else
auto& mods = RE::TESDataHandler::GetSingleton()->files;
size_t actualModCount = 0;
for (const auto mod : mods)
if (mod)
actualModCount++;
#endif
const auto expectedModCount = string::lexical_cast<size_t>(ini.GetValue("Game", "Mod Count", "0"));

const auto shouldRegenerate = actualModCount != expectedModCount;
Expand Down

0 comments on commit 1150e58

Please sign in to comment.