diff --git a/project/code/LGS/ResourcePathManager.cs b/project/code/LGS/ResourcePathManager.cs index 97cb3e8..c557553 100644 --- a/project/code/LGS/ResourcePathManager.cs +++ b/project/code/LGS/ResourcePathManager.cs @@ -93,26 +93,24 @@ public class ResourcePathManager return names; } - public string GetMissionPath(string missionName) - { - if (!_initialised) return null; - - if (_omResources.missionPathMap.TryGetValue(missionName, out var path)) - { - return path; - } - return null; - } - public string GetMissionPath(string campaignName, string missionName) { if (!_initialised) return null; - if (_fmResources.TryGetValue(campaignName, out var campaign) && - campaign.missionPathMap.TryGetValue(missionName, out var path)) + if (campaignName == null || campaignName == "") { - return path; + if (_omResources.missionPathMap.TryGetValue(missionName, out var omPath)) + { + return omPath; + } } + else if ( + _fmResources.TryGetValue(campaignName, out var campaign) && + campaign.missionPathMap.TryGetValue(missionName, out var fmPath)) + { + return fmPath; + } + return null; } diff --git a/project/code/TMV/Mission.cs b/project/code/TMV/Mission.cs index eb66f39..cad5774 100644 --- a/project/code/TMV/Mission.cs +++ b/project/code/TMV/Mission.cs @@ -51,15 +51,7 @@ public partial class Mission : Node3D missionSelector.pathManager = _installPaths; missionSelector.MissionSelected += (string campaign, string mission) => { - if (campaign == null) - { - FileName = _installPaths.GetMissionPath(mission); - } - else - { - FileName = _installPaths.GetMissionPath(campaign, mission); - } - + FileName = _installPaths.GetMissionPath(campaign, mission); Build = true; }; }