
Monstrum Location Manager Fix
Fix location problem with Monstrum modsMonstrumLocationManagerFix
Monstrum mods are fine by itself but it can have problems with other mods that adds locations.
There is sometimes duplication with location proxies so you may devote double offerings to summon a boss.
And there was problem with valheimcuisine's location too. And this mod fixes that.
MonstrumLocationManagerFix is a small BepInEx plugin for Valheim that fixes Therzie's Monstrum and MonstrumDeepNorth location registration at runtime.
What it fixes
In Therzie's location registration flow, LocationManager.Location.AddLocationToZoneSystem can use:
UnityEngine.Object.Destroy(...)
when removing the existing enabled LocationProxy from ZoneSystem.m_locationProxyPrefab.
In this path, deferred destruction can leave the old proxy alive until later in the frame while a replacement proxy is added immediately. That can cause duplicate or conflicting location proxy behavior.
This plugin changes that call to:
UnityEngine.Object.DestroyImmediate(...)
so the cleanup happens immediately during location setup.
Target mods
This plugin only patches loaded assemblies that belong to these plugin GUIDs:
Therzie.MonstrumTherzie.MonstrumDeepNorth
It only targets this method:
LocationManager.Location.AddLocationToZoneSystem
How it works
This is a normal BepInEx plugin, not a preloader patcher.
At startup it:
- Detects whether
Monstrumand/orMonstrumDeepNorthare loaded. - Finds
LocationManager.Location.AddLocationToZoneSystemin those assemblies. - Applies a Harmony transpiler.
- Replaces
Destroy(Object)withDestroyImmediate(Object)in memory.
Important behavior
- Install location:
BepInEx/plugins - Does not modify
Monstrum.dll - Does not modify
MonstrumDeepNorth.dll - Does not write marker files
- Does not clear the BepInEx cache
- Does not require anti-cheat whitelisting for modified Monstrum DLLs
Example log lines
Successful runtime patch:
Loading [MonstrumLocationManagerFix 1.0.0]Patched Monstrum.LocationManager.Location.AddLocationToZoneSystem and replaced 1 Destroy call(s).Patched MonstrumDeepNorth.LocationManager.Location.AddLocationToZoneSystem and replaced 1 Destroy call(s).
Already fixed in the loaded target assembly:
Verified Monstrum.LocationManager.Location.AddLocationToZoneSystem is already using DestroyImmediate.
Patch summary:
Applied runtime patch to 2 LocationManager method(s).
Scope and safety
This plugin is intentionally narrow.
- No config file
- No gameplay changes outside the targeted location proxy cleanup
- No patching of unrelated mods
- No permanent modification of other mods' files
Why this exists
An earlier version solved the issue by rewriting other mods' DLL files on disk. This version keeps the same fix but applies it at runtime instead.