MirageNullPrefabFix

版本 v1.0.2·更新於 2026-08-21

Companion hotfix: stops Mirage's StartOfRound NullReferenceException on v81 when other mods leave null NetworkPrefab entries. Loads alongside Mirage.

模組介紹 作者原文

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() 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 ( 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

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPackqwbarch-Mirage

檔案與校驗

檔案名稱
MirageNullPrefabFix-1.0.2.zip
檔案大小
9.7 KiB
SHA-256
b90e694e408dd053b898bb9861e0738e77b14fda69cf80248f0698306879257d
入庫時間
2026-10-10 06:27