fix: Fixes PlayerConstructed stacking/BODs (#2579)

### Summary

* Removes player constructed as a requirement for BODs.
* When two items stack and they don't match player constructed flags, the resulting stack loses the flag.
This commit is contained in:
Kamron Batman 2026-08-14 17:14:38 -07:00 • committed by GitHub
parent 2dbaa87377
commit be3a08513f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 48 deletions

View file

@ -24,26 +24,6 @@ public class PlayerConstructedStackingTests
private static StackableItem MakeStack(Serial serial, int amount, bool playerConstructed) =>
new(serial) { Amount = amount, PlayerConstructed = playerConstructed };
[Fact]
public void CanStackWith_IsFalseWhenProvenanceDiffers()
{
var bought = MakeStack((Serial)0x1, 5, false);
var crafted = MakeStack((Serial)0x2, 5, true);
try
{
// Both orders must fail. Whichever is the receiver decides the merged pile's flag,
// so allowing either one means the result is decided by drag direction.
Assert.False(bought.CanStackWith(crafted));
Assert.False(crafted.CanStackWith(bought));
}
finally
{
bought.Delete();
crafted.Delete();
}
}
[Theory]
[InlineData(false)]
[InlineData(true)]
@ -63,27 +43,6 @@ public class PlayerConstructedStackingTests
}
}
[Fact]
public void StackWith_RefusesToMergeAcrossProvenance()
{
var bought = MakeStack((Serial)0x1, 5, false);
var crafted = MakeStack((Serial)0x2, 5, true);
try
{
Assert.False(bought.StackWith(null, crafted, false));
Assert.Equal(5, bought.Amount);
Assert.Equal(5, crafted.Amount);
Assert.False(bought.PlayerConstructed);
Assert.False(crafted.Deleted);
}
finally
{
bought.Delete();
crafted.Delete();
}
}
[Theory]
[InlineData(false)]
[InlineData(true)]