You are viewing a potentially older version of this package. View all versions.
Aqlow-ModpackFixes-0.1.0 icon

ModpackFixes

Lightweight modular compatibility and bugfix patches for Lethal Company v81 modpacks, with soft-dependency detection so profile exports never force optional mods.

Date uploaded a week ago
Version 0.1.0
Download link Aqlow-ModpackFixes-0.1.0.zip
Downloads 26
Dependency string Aqlow-ModpackFixes-0.1.0

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2304 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2304

README

ModpackFixes

Lightweight, modular compatibility and bugfix patches for Lethal Company (v81) modpacks.

ModpackFixes is designed for players who share and maintain multiple r2modman / Gale / Thunderstore modpack profiles:

  • Zero forced mod dependencies: Third-party mods are detected dynamically at runtime via BepInEx.Bootstrap.Chainloader and patched via reflection + Harmony. Adding Aqlow-ModpackFixes to an exported profile will never force-install mods you removed in another profile.
  • Per-fix toggles: Every compatibility module has its own [Fixes] toggle in BepInEx/config/dev.aqlow.modpackfixes.cfg (enabled by default).
  • Safe when target mods are absent: Modules whose target mods aren't installed automatically skip startup cleanly with a single log line.

Included Fixes (0.1.0)

1. DawnLib + Mirage Cloned EnemyType DawnEnemyInfo Repair

  • Config key: [Fixes] CopyDawnInfoToClonedEnemyTypes = true
  • Activates when: TeamXiaolan-DawnLib (com.github.teamxiaolan.dawnlib) is loaded
  • Problem: DawnLib injects IDawnObject.DawnInfo (DawnEnemyInfo) onto canonical EnemyType assets during registry freeze. When Mirage (qwbarch-Mirage) has masked enemy spawn control enabled on the host, it calls UnityEngine.Object.Instantiate<EnemyType>(maskedPrefab.enemyType) inside On.TimeOfDay.Start to inject MaskedPlayerEnemy(Clone) across moons. Unity's Object.Instantiate leaves the injected managed DawnInfo backing field null on the clone, causing NullReferenceException in mods that inspect SelectableLevel.Enemies via EnemyType.GetDawnInfo().
  • Fix: Automatically copies DawnEnemyInfo onto any cloned EnemyType whose DawnInfo is null (resolving the canonical donor via enemyPrefab -> EnemyAI.enemyType, with a fallback lookup across loaded EnemyType assets) after TimeOfDay.Start, before RoundManager.LoadNewLevel, and before RoundManager.BeginEnemySpawning.

2. FacilityMeltdown Host Ship Auto-Takeoff Desync Guard

  • Config key: [Fixes] GuardFacilityMeltdownHandleEnemies = true
  • Activates when: loaforc-FacilityMeltdown (me.loaforc.facilitymeltdown) is loaded
  • Problem: In FacilityMeltdown, MeltdownHandler.StartMeltdownClientRpc() calls HandleEnemies() on the server before setting meltdownStarted = true. When HandleEnemies() encounters an EnemyType missing DawnEnemyInfo (such as Mirage's MaskedPlayerEnemy(Clone)), it logs a warning without continuing and throws NullReferenceException on the host before meltdownStarted = true. Non-host clients tick down meltdownTimer and see the ship take off automatically, while the host's MeltdownHandler.Update() returns early forever until the ship lever is pulled manually.
  • Fix: Runs DawnEnemyInfo clone repair immediately before MeltdownHandler.HandleEnemies() executes and wraps HandleEnemies() with a Harmony Finalizer safety net so an enemy-spawning error can never abort StartMeltdownClientRpc() before meltdownStarted = true on the host.

Requirements & Installation

  • Lethal Company: Tested on v81
  • Mod Loader: BepInEx-BepInExPack-5.4.2304
  • Multiplayer Compatibility: Safe on both host and clients (recommended on at least the host; installs cleanly for everyone in shared r2modman profile codes).

Install

Install Aqlow-ModpackFixes via r2modman, Gale, or the Thunderstore Mod Manager, or extract plugins/ModpackFixes.dll into BepInEx/plugins/Aqlow-ModpackFixes/.

Uninstall & Troubleshooting

Remove the package in your mod manager (or delete BepInEx/plugins/Aqlow-ModpackFixes/). Startup activation and skip logs are written to BepInEx/LogOutput.log under [Info :ModpackFixes].


Credits & Disclosure

  • Built for Lethal Company using BepInEx 5 and HarmonyX.
  • Compatibility research against TeamXiaolan-DawnLib, qwbarch-Mirage, and loaforc-FacilityMeltdown.
  • AI Disclosure: Code, automated tests, and procedural package icon authored with GitHub Copilot (Gemini 4 Carbon).
  • License: MIT.

CHANGELOG

Changelog

0.2.0

  • Added LateJoinFix ([Fixes] LateJoinFix = true, [LateJoin] AllowJoiningWhileLanded = true): clean built-in orbit + mid-round late joining with MoreCompany 32-slot support, Execute-stage-only OnPlayerConnectedClientRpc reconciliation (preserving dead players and exact livingPlayers counts), immediate localPlayerController assignment before GenerateNewLevelClientRpc, authoritative CustomMessagingManager round/moon/weather/power/time/suit/voice/trigger state sync, and non-destructive OnPlayerDC cleanup.
  • Added NgoSceneSyncNullParentFix ([Fixes] NgoSceneSyncNullParentFix = true): prevents Netcode for GameObjects SceneEventData.SortChildrenNetworkObjects NullReferenceException / InvalidOperationException when a spawned NetworkObject has a destroyed cached parent during mid-round scene sync, and prevents NetworkConnectionManager.AddClient duplicate-key exceptions on connection retries.
  • Added RadarTargetNameSyncFix ([Fixes] RadarTargetNameSyncFix = true): deterministically deduplicates player usernames across all slots and updates ship radar target names by Transform (ChangeNameOfTargetTransform) so RadarBoosters, darmuhsTerminalStuff, and OpenBodyCams always stay aligned.
  • Added InteractionLockSafetyFix ([Fixes] InteractionLockSafetyFix = true): self-heals InteractTrigger manual special-animation locks orphaned by dead/disconnected players, repairs null localPlayerController in StopSpecialAnimation, and soft-guards LethalCasino's ShowScrapValueHoverTip against out-of-bounds currentItemSlot indices (such as LevelDown carry slot 50).
  • Added EnableBoomBirdBiggerShipFix ([Fixes] EnableBoomBirdBiggerShipFix = true): fixes Biodiversity's Boom Bird (MicBirdAI) with WiderShipMod, Melanie2StoryShip, and enlarged shipBounds by routing exterior perches to NavMesh-verified perimeter anchors outside the ship hull, recovering off-NavMesh spawns, promoting a living leader when firstSpawned dies/despawns, preventing despawnEarly spawn-cap leaks, and ordering outdoor/ship walkies ahead of factory walkies so ToggleAllWalkiesOutsideClientRpc never aborts early.

0.1.0

  • Initial release of ModpackFixes with modular soft-dependency [Fixes] architecture (dev.aqlow.modpackfixes).
  • Added CopyDawnInfoToClonedEnemyTypes: copies DawnLib DawnEnemyInfo from canonical EnemyType donors onto runtime-cloned EnemyType instances such as Mirage's MaskedPlayerEnemy(Clone).
  • Added GuardFacilityMeltdownHandleEnemies: repairs cloned EnemyType instances prior to FacilityMeltdown's MeltdownHandler.HandleEnemies() and guards HandleEnemies() with a Harmony Finalizer so host meltdownStarted and automatic ship takeoff never desync from clients.