fix(world): restore portal and distant use lifecycles

This commit is contained in:
Erik 2026-07-25 09:59:25 +02:00
parent c730632075
commit 1a14812c44
18 changed files with 401 additions and 196 deletions

View file

@ -219,6 +219,26 @@ public sealed class LiveEntityAnimationPresenterTests
Assert.Same(fixture.Record, context.LastRecord);
}
[Fact]
public void MotionDone_CurrentLogicalOwnerResolvesWhileSpatialProjectionIsWithdrawn()
{
var fixture = Build(partCount: 1, withSequencer: true);
var interpreter = new MotionInterpreter(new PhysicsBody());
interpreter.AddToQueue(0, MotionCommand.Ready, 0);
var context = new Context { Motion = interpreter };
var presenter = Presenter(fixture.Live, new EntityEffectPoseRegistry(), context);
Assert.True(fixture.Live.WithdrawLiveEntityProjection(Guid));
Assert.False(fixture.Record.IsSpatiallyProjected);
presenter.PrepareAnimation(fixture.Record, fixture.State);
Assert.NotNull(fixture.State.Sequencer!.MotionDoneTarget);
fixture.State.Sequencer!.MotionDoneTarget!(MotionCommand.Ready, true);
Assert.Equal(1, context.ResolveCount);
Assert.Same(fixture.Record, context.LastRecord);
Assert.False(interpreter.MotionsPending());
}
[Fact]
public void EffectPoseCallback_NestedRuntimeSnapshotDoesNotTruncatePresentation()
{
@ -535,13 +555,14 @@ public sealed class LiveEntityAnimationPresenterTests
private sealed class Context : ILiveAnimationPresentationContext
{
public uint LocalPlayerGuid => 0x50000001u;
public MotionInterpreter? Motion { get; init; }
public int ResolveCount { get; private set; }
public LiveEntityRecord? LastRecord { get; private set; }
public MotionInterpreter? ResolveMotionInterpreter(LiveEntityRecord record)
{
ResolveCount++;
LastRecord = record;
return null;
return Motion;
}
}