Server Exception: CritterAnimalFSM.BudgetedUpdate
NullReferenceException: Object reference not set to an instance of an object
at Rust.Ai.Gen2.FSMTransitionBase.get_Agent () [0x0000a] in <49b6f5bd2352455893fb5c5942f9a19c>:0
at Rust.Ai.Gen2.Trans_IsNavmeshReady.EvaluateInternal (Rust.Ai.Gen2.FSMPayload& payload) [0x000df] in <49b6f5bd2352455893fb5c5942f9a19c>:0
at Rust.Ai.Gen2.FSMTransitionBase.Evaluate (Rust.Ai.Gen2.FSMPayload& payload) [0x00008] in <49b6f5bd2352455893fb5c5942f9a19c>:0
at Rust.Ai.Gen2.FSMComponent.Tick () [0x000f1] in <49b6f5bd2352455893fb5c5942f9a19c>:0
at Rust.Ai.Gen2.FSMComponent+TickFSMWorkQueue.RunJob (Rust.Ai.Gen2.FSMComponent component) [0x0002e] in <49b6f5bd2352455893fb5c5942f9a19c>:0
at PersistentObjectWorkQueue`1[T].RunList (System.Double maximumMilliseconds) [0x0012b] in <20e04d7937e3499f83b3c025d4436fef>:0
at ServerMgr.Update () [0x0085b] in <49b6f5bd2352455893fb5c5942f9a19c>:0
UnityEngine.DebugLogHandler:Internal_LogException_Injected(Exception, IntPtr)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception, Object)
ServerMgr:Update()
Merged post
i got upset and vibe coded a plugin to kill the bugged entity:<br />
C# // Reference: 0Harmony using System; using System.Reflection; using HarmonyLib; using Oxide.Core.Plugins; using UnityEngine; namespace Oxide.Plugins { [Info("Critter FSM Fix", "Custom", "1.0.0")] [Description("Catches FSMTransitionBase NREs at the source and removes bugged critters")] public class CritterFSMFix : RustPlugin { private const string HarmonyId = "com.custom.critterfsmfix"; private Harmony _harmony; private void Init() { _harmony = new Harmony(HarmonyId); MethodInfo targetMethod = AccessTools.Method(typeof(Rust.Ai.Gen2.FSMComponent), "Tick"); MethodInfo finalizerMethod = AccessTools.Method(typeof(CritterFSMFix), nameof(TickFinalizer)); if (targetMethod != null && finalizerMethod != null) { _harmony.Patch(targetMethod, finalizer: new HarmonyMethod(finalizerMethod)); Puts("Patched Rust.Ai.Gen2.FSMComponent.Tick successfully."); } else { PrintWarning("Could not locate Rust.Ai.Gen2.FSMComponent.Tick to patch."); } } private void Unload() { _harmony?.UnpatchAll(HarmonyId); } private static Exception TickFinalizer(Rust.Ai.Gen2.FSMComponent __instance, Exception __exception) { if (__exception is NullReferenceException) { if (__instance != null) { var entity = __instance.GetComponentInParent(); if (entity != null && !entity.IsDestroyed) { entity.Kill(); } else { __instance.enabled = false; } } // Returning null suppresses the exception so ServerMgr.Update never logs it return null; } return __exception; } } }
Merged postHarmony Source Patch & Critter Cleanup (Best for Server FPS)
Simply hiding the console text still leaves the bugged critter throwing and unwinding a C# exception on every single server tick, which costs CPU time and aborts the rest of the CritterAnimalFSM queue for that frame.
If you use Harmony (0Harmony), you can attach a Harmony Finalizer directly to Rust.Ai.Gen2.FSMComponent.Tick(). When a critter hits the null Owner state, this catches the NullReferenceException before ServerMgr.Update() sees it and immediately kills the broken critter entity so it only faults once instead of every tick.
Introducing the Critter Log Blocker you can name it CritterLogBlocker.cs to compile yeah. boom results.