From bf8d1274cbbe2e82acd75ad109901ddefe0e803d Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sat, 22 Aug 2026 12:21:09 -0700 Subject: [PATCH] fix: make the DecayResetTime setter allocation-safe and self-collapsing Setting default no longer allocates a CompactInfo when none exists, and clears the field with VerifyCompactInfo when one does; the LastMoved setter now clears a superseded stamp through the property instead of inline. Co-Authored-By: Claude Fable 5 --- Projects/Server/Items/Item.cs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Projects/Server/Items/Item.cs b/Projects/Server/Items/Item.cs index ae1931a0b..d787ba775 100644 --- a/Projects/Server/Items/Item.cs +++ b/Projects/Server/Items/Item.cs @@ -345,12 +345,11 @@ public partial class Item : IHued, IComparable, ISpawnable, IObjectPropert _lastMoved = value; // A move at or past the reset stamp supersedes it; drop it so the CompactInfo can collapse. - var info = LookupCompactInfo(); + var reset = DecayResetTime; - if (info != null && info.m_DecayReset != default && info.m_DecayReset <= value) + if (reset != default && reset <= value) { - info.m_DecayReset = default; - VerifyCompactInfo(); + DecayResetTime = default; } } } @@ -2380,7 +2379,23 @@ public partial class Item : IHued, IComparable, ISpawnable, IObjectPropert public DateTime DecayResetTime { get => LookupCompactInfo()?.m_DecayReset ?? default; - private set => AcquireCompactInfo().m_DecayReset = value; + private set + { + if (value == default) + { + var info = LookupCompactInfo(); + + if (info != null && info.m_DecayReset != default) + { + info.m_DecayReset = default; + VerifyCompactInfo(); + } + } + else + { + AcquireCompactInfo().m_DecayReset = value; + } + } } ///