From fa2919b81b490288d9dadc299d894598fa7da92e Mon Sep 17 00:00:00 2001 From: RattleSN4K3 Date: Thu, 15 May 2025 02:40:34 +0200 Subject: [PATCH] Fix installing addons post-installation, was using wrong base folder --- LANCommander.SDK/Services/GameService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/LANCommander.SDK/Services/GameService.cs b/LANCommander.SDK/Services/GameService.cs index c4f3eaf6..6003ae01 100644 --- a/LANCommander.SDK/Services/GameService.cs +++ b/LANCommander.SDK/Services/GameService.cs @@ -917,9 +917,18 @@ namespace LANCommander.SDK.Services if ((game.Type == GameType.Expansion || game.Type == GameType.Mod || game.Type == GameType.StandaloneMod) && game.BaseGameId != Guid.Empty) { - var baseGame = await Client.Games.GetAsync(game.BaseGameId); + // modify installation passes the original installation of the game including the game folder, use the existing folder, + // otherwise a name change could lead to installing files into differnt folder + if (Path.Exists(installDirectory) && Path.Exists(Path.Combine(installDirectory, ".lancommander"))) + { + return installDirectory; + } + else + { + var baseGame = await Client.Games.GetAsync(game.BaseGameId); - return await GetInstallDirectory(baseGame, installDirectory); + return await GetInstallDirectory(baseGame, installDirectory); + } } else return Path.Combine(installDirectory, game.Title.SanitizeFilename());