Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
OldModCompat
Lets mods built before v80 load on v80/v81. Forwards DunGen types and rewrites calls to changed game methods (KillPlayer, DisplayMenuNotification and more) in old mod DLLs.
By CELLO_Dev
| Last updated | 2 hours ago |
| Total downloads | 27 |
| Total rating | 0 |
| Categories | AI Generated BepInEx Mods Libraries Misc |
| Dependency string | CELLO_Dev-OldModCompat-1.0.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2305README
OldModCompat
A BepInEx preloader patcher that lets Lethal Company mods built before v80 load on v80 and v81.
What it fixes
- DunGen moved out of
Assembly-CSharp. In v80, DunGen's types moved intoDunGen.dll. Older mods still look for them inAssembly-CSharpand fail withTypeLoadException. On every launch, LegacyCompat adds type forwarders in memory that point those lookups atDunGen.dll. - Game methods whose signatures changed in v80. LegacyCompat rewrites calls in old mod DLLs to use the new signatures, filling any added parameters with their default values:
MenuManager.DisplayMenuNotificationPlayerControllerB.KillPlayerPlayerControllerB.HasLineOfSightToPositionPlayerControllerB.DropAllHeldItemsServerRpc→DropAllHeldItemsAndSyncNonexact- the
SpawnableEnemyWithRarityconstructor
HUDManager.loadingDarkenScreenwas removed in v80. LegacyCompat drops code that setsloadingDarkenScreen.enabled(used by LethalCasino's roulette).
Tested on v81 with:
- IntegrityChaos-Diversity 3.1.0
- mrgrm7-LethalCasino 1.1.3
- Magic_Wesley-WesleysInteriors and Wesleys_Shenanigans
- Zehs-WesleysInteriorsAddon
- loaforc-loaforcsSoundAPI_LethalCompany
How it works
- At startup, it scans
BepInEx/plugins. Only DLLs that still call one of the changed members are rewritten, once, on disk. Mods that are already up to date are not touched. - If your mod manager reinstalls or updates a mod, LegacyCompat fixes it again on the next launch.
- The game itself never gets old-signature overloads. Adding an extra
KillPlayer, for example, would break every mod that looks the method up by name withAmbiguousMatchException. - If one DLL can't be written (it's locked or read-only, for example), LegacyCompat logs an error and keeps fixing the others.
Your log will show lines like these:
[Info :LegacyCompat] Forwarded 134 DunGen types
[Info :LegacyCompat] Rewrote 15 old call(s), 0 removed-field use(s) in Diversity Remastered.dll
Multiplayer
Every player in the lobby who runs the old mods needs LegacyCompat installed.
Uninstalling
Uninstall LegacyCompat, then reinstall the mods it rewrote. The rewritten DLLs stay changed until those mods are reinstalled.
Limitations
LegacyCompat only fixes the changes listed above. A mod that depends on any other behavior that changed or was removed in v80 will still break.
This is an unofficial compatibility patch. It isn't affiliated with the authors of the mods it fixes.