SoulEmper0r-InfiniteDeadHead_Fixed icon

InfiniteDeadHead Fixed

Keeps spectate-head energy full using the current REPO energy logic.

Last updated 2 weeks ago
Total downloads 1786
Total rating 1 
Categories Quality Of Life Client-side Server-side AI Generated Mods
Dependency string SoulEmper0r-InfiniteDeadHead_Fixed-1.1.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

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

Preferred version: 5.4.2305

README

Infinite Dead Head (Fixed)

A separate rebuild of InfiniteDeadHead for REPO. It does not overwrite or modify the original AXIAN mod or any installed profile.

Reverse-engineering findings

The original assembly contains a Harmony postfix on PlayerDeathHead.Update():

SpectateCamera.instance.headEnergy = 1f;

The current game stores spectate-head energy in SpectateCamera.headEnergy. Energy is drained by the private SpectateCamera.HeadEnergyLogic() method, which also calculates headEnergyEnough.

The original patch dereferences the global SpectateCamera.instance from another component's Update without a null check. When that singleton is unavailable, the postfix can throw a NullReferenceException from the patched PlayerDeathHead.Update. The stack trace alone does not prove every occurrence came from this mod, but the unsafe dereference is a concrete defect in its code.

Fix

This build applies a postfix directly to SpectateCamera.HeadEnergyLogic(). After vanilla logic executes, it restores headEnergy = 1f and headEnergyEnough = true. This prevents normal energy drain from exhausting the spectate head and keeps the interaction available.

Private game fields are accessed through cached reflection metadata, so the plugin compiles without relying on internal game members being public. It does not modify PlayerDeathHead.Update, ItemBattery, or the game's networked item-battery system.

Build

The project targets .NET Standard 2.1 to match the current REPO Assembly-CSharp dependency and references local REPO / BepInEx assemblies.

dotnet build .\src\InfiniteDeadHead.Fixed.csproj -c Release -o .\build

The resulting plugin is build\InfiniteDeadHead.Fixed.dll.