FreddyEnemy Patch

v1.0.0·Updated 2026-08-10

An unofficial compatibility patch for OrtonLongGaming's Freddy Enemy mod. Fixes critical crashes and restores AI/Audio logic. Tested on R.E.P.O. v0.4.4.x.

About this mod Author’s original text

FreddyEnemy Patch - Unofficial Compatibility Patch

An unofficial hotfix for the FreddyEnemy mod by OrtonLongGaming.

Link to the original mod page

Compatibility: Tested and working on R.E.P.O. version 0.4.4.x. Other game versions have not been tested and are not guaranteed to work.

Due to recent R.E.P.O. game updates, the original mod causes severe NullReferenceException errors, leading to broken AI and missing sounds. This patch dynamically intercepts and fixes the broken code in the game's RAM, bringing Freddy Fazbear back to life without modifying or reuploading the original mod assets.

Summary of Changes

  • Restored Attack Logic: Fixed the critical crash that occurred whenever Freddy attempted to attack a player.
  • Restored Audio Loops: Fixed the crashes caused by Freddy's Stunned, Haywire, and Cloaked sound effects.
  • Stuck/Pathfinding Fix: Ensured Freddy's StuckCount resets correctly so he doesn't get permanently stuck on the map.
  • Surgical Compatibility: The patch automatically scans for and removes old or conflicting patches targeting Freddy before applying itself, preventing mod conflicts.

Installation

Use a Mod Manager (Recommended):

Simply click "Install with Mod Manager". The original FreddyEnemy mod will be downloaded automatically as a required dependency.

Manual Installation:

  • Install BepInEx.
  • Install the original FreddyEnemy mod.
  • Drop the FreddyEnemy_Patch.dll into your BepInEx/plugins folder.

Technical Details for Developers

Recent R.E.P.O. updates introduced breaking signature changes to core game methods, most notably PlayerHealth.HurtOther and Sound.PlayLoop (both updated to require 5 arguments instead of 4).

Because the original mod's compiled assembly references the outdated signatures, attempting to patch the broken methods (HandleAttack, SfxStunnedLoop, etc.) directly causes Harmony to throw an IL Compile Error (ArgumentNullException: Invalid argument for callvirt NULL). The engine crashes simply by trying to read the broken IL instructions.

To bypass this issue cleanly, this patch uses a Surgical Transpiler approach:

  • Parent Interception: Instead of patching the broken methods, HarmonyTranspiler is applied to their parent methods (EnemyFreddy.Update and EnemyFreddyAnim.Update).
  • Call Rerouting: The transpilers scan for OpCodes.Call instructions pointing to the broken methods, erase them, and reroute the execution flow to custom static C# methods within the patch.
  • Reflection via Traverse: The custom methods rebuild the attack and audio logic from scratch. Harmony's Traverse class is used to dynamically resolve private fields (_stateImpulse, _enemy, _sfxStunnedLoop) and bypass compiler restrictions for hidden variables like StuckCount, effectively injecting the updated 5-argument method calls safely.
  • Pre-patch Cleanup: Uses Harmony.GetPatchInfo to unpatch any potentially conflicting third-party modifications to Freddy's logic before applying the fixes.

Thanks

OrtonLongGaming for creating this fantastic original FreddyEnemy mod.

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPackOrtonLongGaming-FreddyEnemy

File & checksum

Filename
FreddyEnemy_Patch-1.0.0.zip
File size
106.0 KiB