goldenguy00 / LemurFusion

just like dragonball, im back at it again with the same thing but slightly different
1 stars 0 forks source link

Devotees' Egg Don't Despawn After Giving Item #3

Closed Sorukun21 closed 5 months ago

Sorukun21 commented 5 months ago

I did a run with the mod enabled (with some other mods I installed) and I noticed the devotees' egg doesn't despawn once I gave an item, and it spawned as a 'vanilla' Lemurian, which is strange (also the Lemurians' leaderboard is broken as well, it either shows me null master or a Commando icon with no items, despite giving one). I added a log output this time since I didn't add one on my previous issue. Although, it mentioned RiskyMod on the log, which I don't have the mod installed at the moment. Anyway, I hope it helps along with the log I submitted.

LogOutput.log

goldenguy00 commented 5 months ago

Yeah I just learned about this myself the other day as well... Should be fixed now. It's an issue with C# code optimization calling an unloaded reference when the code is checking whether or not that reference is loaded... Strange, I know but it's fixed now. Sorry about that!

goldenguy00 commented 5 months ago

Thanks for the bug report!

goldenguy00 commented 5 months ago

https://risk-of-thunder.github.io/R2Wiki/Mod-Creation/C%23-Programming/Mod-Compatibility%3A-Soft-Dependency/

In case you're curious on the root cause.

The important thing is that anything that require elements from the soft dependencies are only used behind methods that have these two attributes.

[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] This is due to internal details on how the c# runtime works.

If these are not here you'll most likely get exceptions thrown at you telling you the soft dependency is not loaded, even though we properly check with the PluginInfos.ContainsKey!