Skip to content

Commit bfdfd1b

Browse files
committed
fix: load modules when available
1 parent e2688bb commit bfdfd1b

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/main/appframework.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ std::vector<AppSystemInfo> g_appSystems{
6666
{ false, "soundsystem", SOUNDOPSYSTEMEDIT_INTERFACE_VERSION },
6767
{ false, "vphysics2", VPHYSICS2HANDLE_INTERFACE_VERSION },
6868
{ false, "worldrenderer", WORLD_RENDERER_MGR_INTERFACE_VERSION },
69-
{ false, "assetsystem", ASSETSYSTEM_INTERFACE_VERSION, false, CS2_ONLY },
70-
{ false, "assetpreview", ASSETPREVIEWSYSTEM_INTERFACE_VERSION, false, CS2_ONLY },
71-
{ false, "resourcecompiler", RESOURCECOMPILERSYSTEM_INTERFACE_VERSION, false, CS2_ONLY },
72-
{ false, "tools/hammer", "ToolSystem2_001", false, CS2_ONLY},
73-
{ false, "tools/met", "ToolSystem2_001", false, CS2_ONLY},
74-
{ false, "tools/pet", "ToolSystem2_001", false, CS2_ONLY},
75-
{ false, "tools/cs2_item_editor", "ToolSystem2_001", false, CS2_ONLY},
69+
{ false, "assetsystem", ASSETSYSTEM_INTERFACE_VERSION, false },
70+
{ false, "assetpreview", ASSETPREVIEWSYSTEM_INTERFACE_VERSION, false },
71+
{ false, "resourcecompiler", RESOURCECOMPILERSYSTEM_INTERFACE_VERSION, false },
72+
{ false, "tools/hammer", "ToolSystem2_001", false },
73+
{ false, "tools/met", "ToolSystem2_001", false },
74+
{ false, "tools/pet", "ToolSystem2_001", false },
75+
{ false, "tools/cs2_item_editor", "ToolSystem2_001", false },
7676
};
7777

7878
std::map<std::string, IAppSystem*> g_factoryMap;
@@ -155,6 +155,13 @@ void InitializeAppSystems()
155155

156156
std::string path = appSystem.gameBin ? fmt::format("../../{}/bin/{}", GAME_PATH, PLATFORM_FOLDER) : "";
157157

158+
auto targetPath = (std::filesystem::current_path() / path / (MODULE_PREFIX + std::string(appSystem.moduleName) + MODULE_EXT)).lexically_normal().generic_string();
159+
160+
if (!std::filesystem::exists(targetPath)) {
161+
spdlog::info("Skipping module as it does not exist: {}", targetPath);
162+
continue;
163+
}
164+
158165
spdlog::trace("Creating module {}", path);
159166
CModule module(path.c_str(), appSystem.moduleName);
160167

0 commit comments

Comments
 (0)