LethalLibPrefabGuard
Prevents landing soft-locks by cleaning null prefabs/items from LethalLib registrations before StartOfRound.Start, and names the broken mod in the log.
About this mod Author’s original text
LethalLib Prefab Guard
Prevents the "ship stuck in the landing state" soft-lock caused by mods registering
broken (null) items or enemies through LethalLib.
The problem
LethalLib's StartOfRound.Start hook iterates its registered-prefab list before
running the game's own round-start logic. If any mod registered a null prefab
(common after game updates break old asset bundles), that loop throws and the
vanilla StartOfRound.Start never runs. Symptoms:
- Ship stuck in the "landing" state forever — HUD works, nothing else does
- Dark screen / unresponsive controls when loading in
- Ship interior mods (e.g. wider/two-story ships) present but not applying,
with flickering or white-streak textures
What this does
Right before StartOfRound.Start, this guard:
- Removes null entries from LethalLib's prefabsToFix list
- Removes null entries from StartOfRound.allItemsList
- Logs a CULPRIT: warning naming the mod that registered each broken
item/enemy (using LethalLib's own registration metadata), so you know what to
update or remove
If nothing is broken, it does nothing. Works with or without LethalLib installed.
Technical note
A Harmony prefix cannot guard against this: HarmonyX patches the original method
(innermost layer) while MonoMod On. hooks wrap outside it, so LethalLib's hook
throws before any prefix runs. This guard installs its own MonoMod hook after
LethalLib's, making it the outer layer.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: