File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Runtime/PatchManager.Resources Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 11using System . Collections . Generic ;
2+ using System . Linq ;
23using JetBrains . Annotations ;
34using KSP . Game ;
45using Newtonsoft . Json . Linq ;
@@ -24,14 +25,21 @@ public class ResourcesModule : BaseModule
2425
2526 public override void Load ( )
2627 {
27- GameManager . Instance . Assets . LoadByLabel ( "resource_units" , RegisterUnits ,
28- delegate ( IList < TextAsset > assetLocations )
29- {
30- if ( assetLocations != null )
28+ if ( GameManager . Instance . Assets . RegisteredResourceLocators . Any ( x => x . Keys . Contains ( "resource_units" ) ) )
29+ {
30+ GameManager . Instance . Assets . LoadByLabel ( "resource_units" , RegisterUnits ,
31+ delegate ( IList < TextAsset > assetLocations )
3132 {
32- Addressables . Release ( assetLocations ) ;
33- }
34- } ) ;
33+ if ( assetLocations != null )
34+ {
35+ Addressables . Release ( assetLocations ) ;
36+ }
37+ } ) ;
38+ }
39+ else
40+ {
41+ Logging . LogInfo ( "No custom resource units were defined" ) ;
42+ }
3543
3644 PatchManager . Instance . AddComponent < NonStageableResourcesUIController > ( ) ;
3745 }
You can’t perform that action at this time.
0 commit comments