fix(runtime): latch accepted reveal readiness

This commit is contained in:
Erik 2026-07-26 17:17:05 +02:00
parent a6860d5563
commit acb845d812
2 changed files with 1 additions and 21 deletions

View file

@ -91,16 +91,7 @@ public sealed class RuntimeWorldTransitState
} }
if (_snapshot.Readiness.IsReady) if (_snapshot.Readiness.IsReady)
{
if (_snapshot.Readiness == acknowledgement)
return false;
FailInvariant(
"readiness-changed-after-ready",
$"accepted={DescribeReadiness(_snapshot.Readiness)} "
+ $"actual={DescribeReadiness(acknowledgement)}");
return false; return false;
}
bool isIndoor = IsIndoor(acknowledgement.DestinationCell); bool isIndoor = IsIndoor(acknowledgement.DestinationCell);
int requiredRenderRadius = isIndoor ? 0 : 1; int requiredRenderRadius = isIndoor ? 0 : 1;
@ -369,17 +360,6 @@ public sealed class RuntimeWorldTransitState
+ $"failures={snapshot.InvariantFailureCount}"); + $"failures={snapshot.InvariantFailureCount}");
} }
private static string DescribeReadiness(
in RuntimeDestinationReadiness readiness) =>
string.Create(
CultureInfo.InvariantCulture,
$"indoor={readiness.IsIndoor},"
+ $"unhydratable={readiness.IsUnhydratable},"
+ $"radius={readiness.RequiredRenderRadius},"
+ $"render={readiness.IsRenderNeighborhoodReady},"
+ $"composites={readiness.AreCompositeTexturesReady},"
+ $"collision={readiness.IsCollisionReady}");
private static bool IsIndoor(uint cellId) => private static bool IsIndoor(uint cellId) =>
(cellId & 0xFFFFu) >= 0x0100u; (cellId & 0xFFFFu) >= 0x0100u;
} }

View file

@ -166,7 +166,7 @@ public sealed class RuntimeWorldTransitStateTests
Assert.Equal(accepted, state.Snapshot.Readiness); Assert.Equal(accepted, state.Snapshot.Readiness);
Assert.True(state.Snapshot.IsReady); Assert.True(state.Snapshot.IsReady);
Assert.Equal(1, state.Snapshot.InvariantFailureCount); Assert.Equal(0, state.Snapshot.InvariantFailureCount);
} }
[Fact] [Fact]