SamboyCoding / RimworldBetterLoading

Mod for the game RimWorld to add a fancier loading screen.
https://steamcommunity.com/sharedfiles/filedetails/?id=1999454301
22 stars 11 forks source link

"You can only patch implemented methods/constructors" error #3

Closed alextd closed 4 years ago

alextd commented 4 years ago

Problem on these lines: https://github.com/SamboyCoding/RimworldBetterLoading/blob/1293f7761fec51f3aeb9bc7d070014fae7496d24/Source/Compat/HugsLib/StageHugsLibInit.cs#L120

This assumes other mods defined Initialize and DefsLoaded. If they don't, there will be this harmony error (e.g. with SimpleSidearms):

`You can only patch implemented methods/constructors. Path the declared method HugsLib.ModBase.Initialize() instead."

BetterLoading should check before patching here, and make sure the DeclaredType for the method is actually childMod's type and not ModBase.

SamboyCoding commented 4 years ago

Fixed in release 2.3.0.0, thanks for the report!