Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Source/Client/Patches/TimestampFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down