Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Update CustomTroopUpgradesCore.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Designer225 committed Jan 27, 2021
1 parent b8647ad commit 55825b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CustomTroopUpgrades/CustomTroopUpgradesCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ public override void OnGameInitializationFinished(Game game)
// DO NOT USE TaleWorlds.Library.ModuleInfo.GetModules()! It gets ALL modules, not just the active ones.
// Use TaleWorlds.Engine.Utilities.GetModulesNames(), then load ModuleInfos individually.
// That function returns all ACTIVE modules instead.

Modules.AddRange(ModuleHelper.GetModules().Where(x => x.IsOfficial || x.IsSelected));
string[] moduleNames = Utilities.GetModulesNames();
foreach (string moduleName in moduleNames)
{
ModuleInfo m = new ModuleInfo();
m.LoadWithFullPath(ModuleHelper.GetModuleFullPath(moduleName));
Modules.Add(m);
}

XmlSerializer deserializer = new XmlSerializer(typeof(CustomTroopUpgrades));
foreach (ModuleInfo module in Modules)
Expand Down

0 comments on commit 55825b5

Please sign in to comment.