From 8534774e506bbb00cbbfee763528e1a94eaf3e40 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sat, 22 Aug 2026 10:53:31 -0700 Subject: [PATCH] test: pin decay registration for the remainder of a partially lifted ground stack LiftItemDupe places the leftover stack via raw Location/Map assignments with no MoveToWorld fallback for the ground case, so before the Map setter enrolled parentless items the remainder was never tracked and never decayed. Red-checked against the pre-fix behavior. Co-Authored-By: Claude Fable 5 --- .../Tests/Items/DecayRegistrationTests.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Projects/Server.Tests/Tests/Items/DecayRegistrationTests.cs b/Projects/Server.Tests/Tests/Items/DecayRegistrationTests.cs index 63204165f..597ec7e74 100644 --- a/Projects/Server.Tests/Tests/Items/DecayRegistrationTests.cs +++ b/Projects/Server.Tests/Tests/Items/DecayRegistrationTests.cs @@ -390,6 +390,29 @@ public class DecayRegistrationTests item.Delete(); } + // LiftItemDupe places the remainder of a partially lifted ground stack via raw + // Location/Map assignments, with no MoveToWorld fallback: it must still be tracked. + [Fact] + public void PartialLiftOfGroundStack_LeavesRemainderRegisteredForDecay() + { + var stack = new Item(0x1234) { Stackable = true, Amount = 10 }; + stack.MoveToWorld(new Point3D(114, 100, 0), Map.Felucca); + + var remainder = Mobile.LiftItemDupe(stack, 3); + + Assert.NotNull(remainder); + Assert.Equal(7, remainder.Amount); + Assert.Null(remainder.Parent); + Assert.Equal(Map.Felucca, remainder.Map); + Assert.True( + DecayScheduler.IsRegistered(remainder), + "The remainder of a partially lifted ground stack must be tracked for decay." + ); + + stack.Delete(); + remainder.Delete(); + } + // Dropping into a container must untrack; taking it back out to the ground must re-track. [Fact] public void ItemMovedIntoContainerThenBackToGround_IsRegisteredForDecay()