fix(runtime): preserve hidden setposition collision ownership

This commit is contained in:
Erik 2026-08-01 18:22:45 +02:00
parent 9b0f59bd1b
commit 0fbc7a1fb7
8 changed files with 343 additions and 43 deletions

View file

@ -38,6 +38,33 @@ public sealed class ShadowSetPositionCommitTests
Assert.Single(registry.GetObjectsInCell(Cell9)).Position);
}
[Fact]
public void PreparedSuspendedMoveRetainsNewCanonicalPosition()
{
var registry = RegisteredSingle();
var moved = new Vector3(36f, 12f, 50f);
Assert.True(registry.TryPrepareSetPosition(
1u,
moved,
Quaternion.Identity,
Cell9,
0f,
0f,
PhysicsShadowCommitAction.Replace,
[Cell9],
provenShapeless: false,
suspendOwner: true,
out var prepared));
Assert.Single(registry.GetObjectsInCell(Cell1));
Assert.True(registry.TryApplySetPosition(prepared!, out _));
Assert.Empty(registry.GetObjectsInCell(Cell1));
Assert.Empty(registry.GetObjectsInCell(Cell9));
Assert.Equal(1, registry.SuspendedRegistrationCount);
Assert.Equal(moved, prepared!.OwnerState!.Registration.EntityWorldPos);
Assert.Equal(Cell9, prepared.OwnerState.Registration.SeedCellId);
}
[Fact]
public void PreparedCrossPrefixDispatchesMembershipThenMutationOnce()
{