From da473fb3d1aaa6366fecc0a3155330551481ffae Mon Sep 17 00:00:00 2001 From: Alexey Nikitin Date: Sat, 8 Aug 2026 19:07:40 -0500 Subject: [PATCH] Skip timestamp fixing for destroyed pawns FixPawn shifts a pawn's timestamps when it crosses between time contexts, and visits the pawn's fields by saving it, so that a prefix on RegisterDeepSaved can rewrite each one as the scribe walks past. Vanilla warns when a deep save reaches a destroyed thing, so each visit for a dead pawn logged Deep-saving destroyed thing X with saveDestroyedThings==false Anything killed on a map reaches WorldPawns.AddPawn through Destroy, so an ordinary predator hunt produced one warning per kill. Return early instead. The fields involved -- canSleepTick, canLovinTick, ticksWhenAllowedToEscapeAgain, lastPrisonBreakTicks -- all describe behaviour only a live pawn has, so there is nothing to correct. A pawn that is later resurrected and spawned gets the correction from the SpawnSetup path. --- Source/Client/Patches/TimestampFixer.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/Client/Patches/TimestampFixer.cs b/Source/Client/Patches/TimestampFixer.cs index 5526021d1..cc1fdf253 100644 --- a/Source/Client/Patches/TimestampFixer.cs +++ b/Source/Client/Patches/TimestampFixer.cs @@ -33,6 +33,17 @@ static TimestampFixer() public static void FixPawn(Pawn p, Map oldMap, Map newMap) { + // Return early for two reasons. + // + // Nothing to fix: this method shifts four timestamps, and all four cover things only a + // live pawn does -- sleeping, lovin', escaping, breaking out of prison. + // + // Nothing but noise if we try: the method reads the pawn's data by saving it, and the + // game warns when a save touches a destroyed thing. Every kill on a map passes through + // here, so that was one warning per dead squirrel. + if (p.Destroyed) + return; + var oldTime = oldMap?.AsyncTime().mapTicks ?? Multiplayer.AsyncWorldTime.worldTicks; var newTime = newMap?.AsyncTime().mapTicks ?? Multiplayer.AsyncWorldTime.worldTicks; currentOffset = newTime - oldTime;