Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badly formed material replacement patches can cause part compilation failures #20

Open
JonnyOThan opened this issue Feb 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@JonnyOThan
Copy link
Contributor

I'm still investigating but I think a replacement like this:

        SHABBY_MATERIAL_REPLACE
        {
            materialDef = ReStockPlainGlossPatch
        }

Can cause a part to fail to compile:

[LOG 18:55:24.263] PartLoader: Compiling Part 'KFC/parts/GNcap/Cap/GNcap'
[ERR 18:55:24.267] PartLoader: Encountered exception during compilation. System.ArgumentNullException: Value cannot be null.
Parameter name: key
  at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00008] in <9577ac7a62ef43179789031239ba8798>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at Shabby.MaterialReplacement.ApplyToSharedMaterialIfNotIgnored (UnityEngine.Renderer renderer) [0x00011] in <341df764a3bf4dd3b7667567cb943eb3>:0 
  at Shabby.MaterialReplacementPatch.Postfix (UnityEngine.GameObject& __result, ConfigNode partCfg) [0x000b3] in <341df764a3bf4dd3b7667567cb943eb3>:0 
  at (wrapper dynamic-method) PartLoader.PartLoader.CompileModel_Patch1(PartLoader,UrlDir/UrlConfig,ConfigNode,single,AvailablePart)
  at PartLoader.ParsePart (UrlDir+UrlConfig urlConfig, ConfigNode node) [0x00103] in <4b449f2841f84227adfaad3149c8fdba>:0 
  at (wrapper dynamic-method) PartLoader+<CompileParts>d__56.PartLoader+<CompileParts>d__56.MoveNext_Patch0(PartLoader/<CompileParts>d__56)

[ERR 18:55:24.267] PartCompiler: Cannot compile part

In this case it seems to be triggered by shinefix:

[LOG 18:52:26.527] Applying update 000_ShineFix/1_ReStock/_Part/@PART:HAS[!MODULE[ModuleDeployableSolarPanel]]:NEEDS[ReStock]:FOR[000_ShineFix] to KFC/parts/GNcap/Cap.cfg/PART[GNcap]
[LOG 18:52:26.527] Applying update 000_ShineFix/1_ReStock/_Part/@PART:HAS[!MODULE[ModuleDeployableSolarPanel]]:NEEDS[ReStock]:FOR[000_ShineFix] to KFC/parts/GNcap_f/Capf.cfg/PART[GNcap_f]
[LOG 18:52:26.823] Applying update 000_ShineFix/1_ReStock/_Part/@PART:HAS[!RESOURCE[XenonGas]]:NEEDS[ReStock]:FOR[000_ShineFix] to KFC/parts/GNcap/Cap.cfg/PART[GNcap]
[LOG 18:52:26.823] Applying update 000_ShineFix/1_ReStock/_Part/@PART:HAS[!RESOURCE[XenonGas]]:NEEDS[ReStock]:FOR[000_ShineFix] to KFC/parts/GNcap_f/Capf.cfg/PART[GNcap_f]
@JonnyOThan JonnyOThan added the bug Something isn't working label Feb 6, 2025
@JonnyOThan
Copy link
Contributor Author

I've confirmed that I can repro this by installing shinefix, restock, and gndrive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant