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.
MirageNullPrefabFix
Companion hotfix: stops Mirage's StartOfRound NullReferenceException on v81 when other mods leave null NetworkPrefab entries. Loads alongside Mirage.
| Date uploaded | 18 hours ago |
| Version | 1.0.2 |
| Download link | AzureCore-MirageNullPrefabFix-1.0.2.zip |
| Downloads | 25 |
| Dependency string | AzureCore-MirageNullPrefabFix-1.0.2 |
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.2100qwbarch-Mirage
Voice mimicking where all players hear the same voice, with a focus on masked enemies. Alternative to Skinwalkers + MaskedEnemyOverhaul.
Preferred version: 1.29.1README
Mirage Null-Prefab Fix
A tiny companion hotfix for qwbarch's Mirage on Lethal Company v81. Install it alongside Mirage — it does not replace or modify Mirage.
The bug
On v81, Mirage's StartOfRound.Start hook walks NetworkManager.NetworkConfig.Prefabs and calls GetComponent<EnemyAI>() on each prefab. Some content mods register malformed NetworkPrefab entries (duplicate/zero GlobalObjectIdHash) that leave a null Prefab in that list. Calling GetComponent on it throws a NullReferenceException that aborts the hook — which can leave you staring at a black void in orbit (camera never enables) with soundmanager log spam.
The fix
This mod removes the null-Prefab entries from NetworkConfig.Prefabs in a StartOfRound.Start prefix. Mirage runs orig.Invoke before its own loop, so the prefix executes first and Mirage never sees a null. It only touches vanilla Netcode — it does not copy or modify any Mirage code.
Temporary
This mirrors the guard in Mirage PR #212 (https://github.com/qwbarch/mirage/pull/212). Once qwbarch merges it and releases upstream, this mod is no longer needed and will be deprecated — just uninstall it then.
All credit for Mirage goes to qwbarch. This is an independent, interoperating patch published with qwbarch's blessing.
— AzureCore
CHANGELOG
Changelog
1.0.2
- Release build. Same fix as validated, with quiet logging (only logs when it removes an entry).
1.0.1 / 1.0.0 (dev)
- Iterated on the hook target. Root cause: a null-
Prefabentry is registered during vanillaStartOfRound.Awake, which Mirage's post-origenemy-registration loop then trips on. Fixed by sanitizing null-Prefabentries in a prefix and postfix onStartOfRound.Awake(andStart, for future/PR builds). The Awake postfix is the one that catches it.