refactor: single CompactInfo lookup when LastMoved clears the reset stamp
Going through the DecayResetTime property re-ran LookupCompactInfo and the default check on every set; core code accesses the field directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
bf8d1274cb
commit
8067a7d0aa
1 changed files with 4 additions and 3 deletions
|
|
@ -345,11 +345,12 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
|
||||||
_lastMoved = value;
|
_lastMoved = value;
|
||||||
|
|
||||||
// A move at or past the reset stamp supersedes it; drop it so the CompactInfo can collapse.
|
// A move at or past the reset stamp supersedes it; drop it so the CompactInfo can collapse.
|
||||||
var reset = DecayResetTime;
|
var info = LookupCompactInfo();
|
||||||
|
|
||||||
if (reset != default && reset <= value)
|
if (info != null && info.m_DecayReset != default && info.m_DecayReset <= value)
|
||||||
{
|
{
|
||||||
DecayResetTime = default;
|
info.m_DecayReset = default;
|
||||||
|
VerifyCompactInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue