Recover retained route state and complete PostLoad availability tails

This commit is contained in:
UnixNight committed 2026-10-26 03:58:52 -04:00
1 parent 1dddfefc68
commit 9ad5a8ef6b
36 files changed
+1559 -32

No files matched your search

+18
View File
@@ -117,6 +117,24 @@ public sealed class LabSimulation
CameraEye = DesiredEye().Eye;
}
public PlayerLevelState? CaptureLevelState(int selectedGadget) => Noclip ? null
: new(LevelCode, selectedGadget, movementMode, jumpState.HoldSeconds, jumpState.EffectRemaining);
/// <summary>Apply after destination construction. Init re-applies authored
/// body vectors and clears speed/turn; PostLoad resets jump, not these scalars.
/// Grounding and the next controller/fire tick may change them independently.</summary>
public bool ApplyRetainedLevelState(PlayerLevelState state)
{
ArgumentNullException.ThrowIfNull(state);
if (!state.SupportsDestination(LevelCode)) return false;
if (state.MovementMode is < 0 or > 1 || !float.IsFinite(state.HoldSeconds)
|| state.HoldSeconds < 0 || !float.IsFinite(state.EffectRemaining))
throw new ArgumentOutOfRangeException(nameof(state));
movementMode = state.MovementMode;
jumpState = new(0, state.HoldSeconds, state.EffectRemaining);
return true;
}
// EXE 0x47F940 truncates, then degree lookup masks to the 16384-entry table.
// Table generated with modern trig; x87 bit-identical table recovery is pending.
public static (float Sin, float Cos) Trig(float degrees)