fix: LastMoved and stat-gain stamps stay absolute across restarts (#2729)

ReadAnchoredTime shifted Item.LastMoved, Item.DecayResetTime and
Mobile.LastStr/Int/DexGain forward by the downtime at load. The bytes
were stable from save to save, but the first save after every restart
rewrote one timestamp in nearly every item record and most mobile
records, which defeats any per-record backup or delta save.

- LastMoved and DecayResetTime are read as saved. The downtime credit
  is applied after load by Item.CreditDowntimeToDecay, which moves
  DecayResetTime only for items whose decay countdown was still running
  when the save started. Every other item keeps its bytes, and decay
  timing is unchanged.
- World.LoadedSaveStartTime exposes the loaded save's anchor so the
  credit can tell which countdowns were running.
- Stat-gain stamps are read raw. The cooldown is minutes long, so
  downtime counting toward it costs nothing.

No format change: these fields were already absolute ticks.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kamron Batman 2026-10-25 16:27:12 -07:00 • committed by GitHub
parent ab59efea86
commit 9af7dd555a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 157 additions and 12 deletions

View file

@ -529,6 +529,7 @@ public class GenericEntityPersistence<T> : GenericPersistence, IGenericEntityPer
// The whole save shares one anchor. Publish it so payloads without their own
// (GenericPersistence bins) can shift too; indexes load before any of them.
World.LoadTimeShift = _anchoredTimeShift;
World.LoadedSaveStartTime = anchor;
}
if (version >= 4)