Skip to content

Commit

Permalink
Update esplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ortham committed Jun 27, 2024
1 parent 7e87b7a commit 7c6d84f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/api/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ void Game::LoadPlugins(const std::vector<std::filesystem::path>& pluginPaths,
}
});

if (!loadHeadersOnly && GetType() == GameType::starfield) {
if (!loadHeadersOnly &&
(GetType() == GameType::tes3 || GetType() == GameType::starfield)) {
auto plugins = cache_.GetPlugins();
const auto pluginsMetadata = Plugin::GetPluginsMetadata(plugins);
for (auto& plugin : plugins) {
Expand Down
10 changes: 9 additions & 1 deletion src/tests/api/internals/plugin_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,15 @@ TEST_P(PluginTest, loadingWholePluginShouldReadFields) {
false);

if (GetParam() == GameType::tes3) {
EXPECT_EQ(0, plugin.GetOverrideRecordCount());
Plugin master(game_.GetType(),
game_.GetCache(),
game_.DataPath() / "Blank.esm",
false);
const auto pluginsMetadata = Plugin::GetPluginsMetadata({&master});

EXPECT_NO_THROW(plugin.ResolveRecordIds(pluginsMetadata.get()));

EXPECT_EQ(4, plugin.GetOverrideRecordCount());
} else if (GetParam() == GameType::starfield) {
Plugin master(game_.GetType(),
game_.GetCache(), game_.DataPath() / "Blank.full.esm",
Expand Down

0 comments on commit 7c6d84f

Please sign in to comment.