From 02ad6d68cfdaa14fe85a422ddff1a34684e93b7b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 5 Dec 2026 23:39:17 +0100 Subject: [PATCH] Fix Soul HUD/MP findings: camera-local offscreen arrows, panel avoidance, dead-observer clear, remote CoreHpRatio sync, and OFL notice staging --- client/Hud.cs | 216 ++++++++++++++---- client/Main.cs | 25 +- src/RustToDust.Core/GridChassis.cs | 6 + src/RustToDust.Net/RemoteArenaSession.cs | 1 + src/RustToDust.Ymir/ArenaSession.cs | 5 + .../CultNetMultiplayerTests.cs | 34 +++ tests/RustToDust.Tests/DetectionLosTests.cs | 25 ++ tools/build_release.ps1 | 6 + 8 files changed, 270 insertions(+), 48 deletions(-) diff --git a/client/Hud.cs b/client/Hud.cs index 8f6a0cb..f2a60f0 100644 --- a/client/Hud.cs +++ b/client/Hud.cs @@ -38,7 +38,7 @@ public partial class Hud : CanvasLayer private readonly Func _getSession; private readonly Action _onEquipCargo; private readonly Func _getCameraYaw; - private readonly Func? _projectWorld; + private readonly Func? _projectWorld; private Label _chassisHeader = null!; private Label _planeBadge = null!; @@ -101,7 +101,7 @@ public partial class Hud : CanvasLayer Func getSession, Action onEquipCargo, Func? getCameraYaw = null, - Func? projectWorld = null) + Func? projectWorld = null) { _getSession = getSession; _onEquipCargo = onEquipCargo; @@ -300,6 +300,7 @@ public partial class Hud : CanvasLayer BuildBottomCenterChyron(); BuildOutcomeBanner(); BuildNetworkPanel(); + _worldMarkers.SetAvoidPanels(_topLeftPanel, _topRightPanel, _bottomLeftPanel, _chyronPanel); } public bool IsPointerOverInteractiveHud(Vector2 screenPos) @@ -1959,21 +1960,20 @@ public partial class Hud : CanvasLayer private sealed partial class WorldMarkerOverlay : Control { private const float BorderPad = 36f; + private const float PanelAvoidPad = 18f; private const float OffscreenHostileMaxDistance = 220f; private const int MaxOffscreenHostileArrows = 6; private readonly struct OffscreenMarker { - public readonly Vector2 ScreenPos; - public readonly bool Behind; + public readonly System.Numerics.Vector3 CamLocal; public readonly float Distance; public readonly Color Color; public readonly bool IsLockedOnLocal; - public OffscreenMarker(Vector2 screenPos, bool behind, float distance, Color color, bool isLockedOnLocal) + public OffscreenMarker(System.Numerics.Vector3 camLocal, float distance, Color color, bool isLockedOnLocal) { - ScreenPos = screenPos; - Behind = behind; + CamLocal = camLocal; Distance = distance; Color = color; IsLockedOnLocal = isLockedOnLocal; @@ -1981,15 +1981,21 @@ public partial class Hud : CanvasLayer } private IClientArenaSession? _session; - private Func? _projectWorld; + private Func? _projectWorld; + private Control?[] _avoidPanels = Array.Empty(); private readonly List _offscreenHostiles = new(16); private readonly Vector2[] _cornerBuf = new Vector2[3]; private readonly Vector2[] _triBuf = new Vector2[3]; private readonly Vector2[] _shadowTriBuf = new Vector2[3]; + public void SetAvoidPanels(params Control?[] panels) + { + _avoidPanels = panels ?? Array.Empty(); + } + public void SetState( IClientArenaSession session, - Func? projectWorld) + Func? projectWorld) { _session = session; _projectWorld = projectWorld; @@ -2002,6 +2008,7 @@ public partial class Hud : CanvasLayer int localId = _session.LocalContenderId; if (localId < 0 || localId >= state.Contenders.Count) return; + if (!state.Contenders[localId].Alive) return; Vector2 viewSize = Size; if (viewSize.X < 64f || viewSize.Y < 64f) return; @@ -2024,10 +2031,10 @@ public partial class Hud : CanvasLayer float dist = (allyPos - localPos).Length(); float headOffset = c.IsInDropPod ? 3.4f : (c.Grid.Spec.HalfHeight + 1.9f); var worldHead = new System.Numerics.Vector3(allyPos.X, allyPos.Y + headOffset, allyPos.Z); - var (visible, behind, sp) = _projectWorld(worldHead); - if (!visible) continue; + var (valid, inFront, sp, camLocal) = _projectWorld(worldHead); + if (!valid) continue; - bool inFrame = !behind && + bool inFrame = inFront && sp.X >= BorderPad && sp.X <= viewSize.X - BorderPad && sp.Y >= BorderPad && sp.Y <= viewSize.Y - BorderPad; @@ -2049,22 +2056,15 @@ public partial class Hud : CanvasLayer } else { - Vector2 dir = behind ? (center - sp) : (sp - center); - if (dir.LengthSquared() < 1e-4f) dir = Vector2.Up; - else dir = dir.Normalized(); - - float tx = MathF.Abs(dir.X) > 1e-4f ? halfW / MathF.Abs(dir.X) : float.PositiveInfinity; - float ty = MathF.Abs(dir.Y) > 1e-4f ? halfH / MathF.Abs(dir.Y) : float.PositiveInfinity; - Vector2 edge = center + dir * MathF.Min(tx, ty); + Vector2 dir = ComputeOffscreenDirection(camLocal); + Vector2 edge = ComputeSafeEdgePos(center, halfW, halfH, dir); Vector2 perp = new(-dir.Y, dir.X); _triBuf[0] = edge + dir * 7f; _triBuf[1] = edge - dir * 5f + perp * 5f; _triBuf[2] = edge - dir * 5f - perp * 5f; DrawColoredPolygon(_triBuf, new Color(AlliedCol.R, AlliedCol.G, AlliedCol.B, 0.88f)); - Vector2 textPos = new( - Math.Clamp(edge.X - 32f, 10f, viewSize.X - 110f), - Math.Clamp(edge.Y + (dir.Y > 0f ? -12f : 18f), 16f, viewSize.Y - 12f)); + Vector2 textPos = ComputeInwardLabelPos(edge, dir, viewSize, font, label); DrawString( font, textPos, @@ -2116,7 +2116,7 @@ public partial class Hud : CanvasLayer var (pos, rot, _) = _session.GetInterpolatedSpectatorPose(s.Id, 1f); float dist = (pos - localPos).Length(); - bool lockedOnLocal = s.TargetContenderId == localId && s.HasTargetLos; + bool lockedOnLocal = s.TargetContenderId == localId; float hpRatio = s.Grid.MaxCoreHp > 0f ? s.Grid.CoreHp / s.Grid.MaxCoreHp : 1f; ProcessHostileTarget( @@ -2155,10 +2155,10 @@ public partial class Hud : CanvasLayer Vector2 viewSize, Font font) { - var (cVis, cBehind, cSp) = _projectWorld!(worldCenter); - if (!cVis) return; + var (cValid, cInFront, cSp, cCamLocal) = _projectWorld!(worldCenter); + if (!cValid) return; - bool inFrame = !cBehind && + bool inFrame = cInFront && cSp.X >= BorderPad && cSp.X <= viewSize.X - BorderPad && cSp.Y >= BorderPad && cSp.Y <= viewSize.Y - BorderPad; @@ -2166,7 +2166,7 @@ public partial class Hud : CanvasLayer { if (isLockedOnLocal || dist <= OffscreenHostileMaxDistance) { - _offscreenHostiles.Add(new OffscreenMarker(cSp, cBehind, dist, col, isLockedOnLocal)); + _offscreenHostiles.Add(new OffscreenMarker(cCamLocal, dist, col, isLockedOnLocal)); } return; } @@ -2183,8 +2183,8 @@ public partial class Hud : CanvasLayer { var localCorner = new System.Numerics.Vector3(sx * halfBoundW, sy * halfBoundH, sz * halfBoundL); var worldCorner = worldCenter + System.Numerics.Vector3.Transform(localCorner, rot); - var (vis, beh, sp) = _projectWorld(worldCorner); - if (!vis || beh) + var (valid, inFront, sp, _) = _projectWorld(worldCorner); + if (!valid || !inFront) { allCornersInFront = false; break; @@ -2201,9 +2201,9 @@ public partial class Hud : CanvasLayer if (!allCornersInFront) { - var (topVis, topBeh, topSp) = _projectWorld(worldCenter + new System.Numerics.Vector3(0f, halfBoundH, 0f)); - var (botVis, botBeh, botSp) = _projectWorld(worldCenter - new System.Numerics.Vector3(0f, halfBoundH, 0f)); - float rawH = (topVis && !topBeh && botVis && !botBeh) + var (topValid, topFront, topSp, _) = _projectWorld(worldCenter + new System.Numerics.Vector3(0f, halfBoundH, 0f)); + var (botValid, botFront, botSp, _) = _projectWorld(worldCenter - new System.Numerics.Vector3(0f, halfBoundH, 0f)); + float rawH = (topValid && topFront && botValid && botFront) ? MathF.Abs(botSp.Y - topSp.Y) + 8f : 44f; float horizRadius = MathF.Max(halfBoundW, halfBoundL); @@ -2286,13 +2286,8 @@ public partial class Hud : CanvasLayer private void DrawOffscreenArrow(OffscreenMarker m, Vector2 viewSize, Vector2 center, float halfW, float halfH, Font font) { - Vector2 dir = m.Behind ? (center - m.ScreenPos) : (m.ScreenPos - center); - if (dir.LengthSquared() < 1e-4f) dir = Vector2.Up; - else dir = dir.Normalized(); - - float tx = MathF.Abs(dir.X) > 1e-4f ? halfW / MathF.Abs(dir.X) : float.PositiveInfinity; - float ty = MathF.Abs(dir.Y) > 1e-4f ? halfH / MathF.Abs(dir.Y) : float.PositiveInfinity; - Vector2 edge = center + dir * MathF.Min(tx, ty); + Vector2 dir = ComputeOffscreenDirection(m.CamLocal); + Vector2 edge = ComputeSafeEdgePos(center, halfW, halfH, dir); Vector2 perp = new(-dir.Y, dir.X); _shadowTriBuf[0] = edge + dir * 10f; @@ -2307,13 +2302,146 @@ public partial class Hud : CanvasLayer DrawColoredPolygon(_triBuf, arrowCol); string label = m.IsLockedOnLocal ? $"{m.Distance:F0}m !" : $"{m.Distance:F0}m"; - Vector2 sz = font.GetStringSize(label, HorizontalAlignment.Left, -1, 10); - Vector2 inward = edge - dir * 17f; - Vector2 textPos = new( - Math.Clamp(inward.X - sz.X * 0.5f, 10f, viewSize.X - sz.X - 10f), - Math.Clamp(inward.Y + sz.Y * 0.35f, 16f, viewSize.Y - 10f)); + Vector2 textPos = ComputeInwardLabelPos(edge, dir, viewSize, font, label); DrawString(font, textPos + new Vector2(1f, 1f), label, HorizontalAlignment.Left, -1, 10, new Color(0.04f, 0.05f, 0.04f, 0.90f)); DrawString(font, textPos, label, HorizontalAlignment.Left, -1, 10, arrowCol); } + + private static Vector2 ComputeOffscreenDirection(System.Numerics.Vector3 camLocal) + { + if (!float.IsFinite(camLocal.X) || !float.IsFinite(camLocal.Y) || !float.IsFinite(camLocal.Z)) + { + return Vector2.Down; + } + + Vector2 dir; + if (camLocal.Z >= 0f) + { + dir = new Vector2(camLocal.X, -camLocal.Y); + } + else + { + float horiz = MathF.Sqrt(camLocal.X * camLocal.X + camLocal.Z * camLocal.Z); + float t = Math.Clamp(-camLocal.Z / MathF.Max(1e-4f, horiz * 0.35f), 0f, 1f); + Vector2 sideDir = new(camLocal.X, -camLocal.Y); + Vector2 behindArcDir = new(camLocal.X, MathF.Max(-camLocal.Z, 0.35f * horiz)); + dir = sideDir.Lerp(behindArcDir, t); + if (MathF.Abs(camLocal.X) < 0.35f * horiz) + { + float minDown = 0.25f * dir.Length(); + if (dir.Y < minDown) + { + dir.Y = MathF.Max(minDown, 0.25f); + } + } + } + + float lenSq = dir.LengthSquared(); + if (!float.IsFinite(lenSq) || lenSq < 1e-6f) + { + return camLocal.Z < 0f ? Vector2.Down : Vector2.Up; + } + return dir / MathF.Sqrt(lenSq); + } + + private Vector2 ComputeSafeEdgePos(Vector2 center, float halfW, float halfH, Vector2 dir) + { + float tx = MathF.Abs(dir.X) > 1e-4f ? halfW / MathF.Abs(dir.X) : float.PositiveInfinity; + float ty = MathF.Abs(dir.Y) > 1e-4f ? halfH / MathF.Abs(dir.Y) : float.PositiveInfinity; + float tBest = MathF.Min(tx, ty); + + for (int i = 0; i < _avoidPanels.Length; i++) + { + var panel = _avoidPanels[i]; + if (panel is null || !panel.Visible) continue; + Rect2 r = panel.GetGlobalRect().Grow(PanelAvoidPad); + if (r.HasPoint(center)) continue; + if (TryRayEnterRect(center, dir, r, out float tEnter) && tEnter > 24f && tEnter < tBest) + { + tBest = tEnter; + } + } + + tBest = MathF.Max(24f, tBest); + return center + dir * tBest; + } + + private static bool TryRayEnterRect(Vector2 origin, Vector2 dir, Rect2 r, out float tEnter) + { + float tMin = 0f; + float tMax = float.PositiveInfinity; + + if (MathF.Abs(dir.X) < 1e-5f) + { + if (origin.X < r.Position.X || origin.X > r.End.X) + { + tEnter = 0f; + return false; + } + } + else + { + float invX = 1f / dir.X; + float t1 = (r.Position.X - origin.X) * invX; + float t2 = (r.End.X - origin.X) * invX; + if (t1 > t2) (t1, t2) = (t2, t1); + tMin = MathF.Max(tMin, t1); + tMax = MathF.Min(tMax, t2); + if (tMin > tMax) + { + tEnter = 0f; + return false; + } + } + + if (MathF.Abs(dir.Y) < 1e-5f) + { + if (origin.Y < r.Position.Y || origin.Y > r.End.Y) + { + tEnter = 0f; + return false; + } + } + else + { + float invY = 1f / dir.Y; + float t1 = (r.Position.Y - origin.Y) * invY; + float t2 = (r.End.Y - origin.Y) * invY; + if (t1 > t2) (t1, t2) = (t2, t1); + tMin = MathF.Max(tMin, t1); + tMax = MathF.Min(tMax, t2); + if (tMin > tMax) + { + tEnter = 0f; + return false; + } + } + + tEnter = tMin; + return true; + } + + private static Vector2 ComputeInwardLabelPos(Vector2 edge, Vector2 dir, Vector2 viewSize, Font font, string label) + { + Vector2 sz = font.GetStringSize(label, HorizontalAlignment.Left, -1, 10); + Vector2 inward = edge - dir * 14f; + float textX; + float textY; + + if (MathF.Abs(dir.X) >= MathF.Abs(dir.Y)) + { + textX = dir.X > 0f ? (inward.X - sz.X - 4f) : (inward.X + 6f); + textY = inward.Y + sz.Y * 0.3f; + } + else + { + textX = inward.X - sz.X * 0.5f; + textY = dir.Y > 0f ? (inward.Y - 4f) : (inward.Y + sz.Y + 4f); + } + + return new Vector2( + Math.Clamp(textX, 10f, MathF.Max(10f, viewSize.X - sz.X - 10f)), + Math.Clamp(textY, 16f, MathF.Max(16f, viewSize.Y - 10f))); + } } } diff --git a/client/Main.cs b/client/Main.cs index bb1432f..1d9c020 100644 --- a/client/Main.cs +++ b/client/Main.cs @@ -2104,15 +2104,32 @@ public partial class Main : Node3D _session?.RequestEquipCargo(cargoIndex, hardpointId); } - private (bool Visible, bool Behind, Vector2 ScreenPos) ProjectWorldToHud(System.Numerics.Vector3 worldPos) + private (bool Valid, bool InFront, Vector2 ScreenPos, System.Numerics.Vector3 CamLocal) ProjectWorldToHud(System.Numerics.Vector3 worldPos) { if (_camera is null || !GodotObject.IsInstanceValid(_camera) || !_camera.IsInsideTree()) { - return (false, false, Vector2.Zero); + return (false, false, Vector2.Zero, System.Numerics.Vector3.Zero); } var wp = new Vector3(worldPos.X, worldPos.Y, worldPos.Z); - bool behind = _camera.IsPositionBehind(wp); + Transform3D camXform = _camera.GlobalTransform; + Vector3 rel = wp - camXform.Origin; + Basis b = camXform.Basis; + // Godot Camera3D local axes: +X = right, +Y = up, -Z = forward + float localRight = rel.Dot(b.X); + float localUp = rel.Dot(b.Y); + float localForward = -rel.Dot(b.Z); + var camLocal = new System.Numerics.Vector3(localRight, localUp, localForward); + + if (localForward <= 0.1f) + { + return (true, false, Vector2.Zero, camLocal); + } + Vector2 sp = _camera.UnprojectPosition(wp); - return (true, behind, sp); + if (!float.IsFinite(sp.X) || !float.IsFinite(sp.Y)) + { + return (true, false, Vector2.Zero, camLocal); + } + return (true, true, sp, camLocal); } } diff --git a/src/RustToDust.Core/GridChassis.cs b/src/RustToDust.Core/GridChassis.cs index 8979b54..e3fd867 100644 --- a/src/RustToDust.Core/GridChassis.cs +++ b/src/RustToDust.Core/GridChassis.cs @@ -890,6 +890,12 @@ namespace RustToDust.Core UpdateMountedTelemetry(); } + public void ApplyReplicatedCoreHpRatio(float coreHpRatio) + { + if (MaxCoreHp <= 0f) return; + CoreHp = Math.Clamp(coreHpRatio, 0f, 1f) * MaxCoreHp; + } + public void ApplyReplicatedThermal(ReadOnlySpan quantizedCellTemps, ReadOnlySpan mountedTemps, ReadOnlySpan mountedCooldowns) { int idx = 0; diff --git a/src/RustToDust.Net/RemoteArenaSession.cs b/src/RustToDust.Net/RemoteArenaSession.cs index 6d8b5e9..5855c80 100644 --- a/src/RustToDust.Net/RemoteArenaSession.cs +++ b/src/RustToDust.Net/RemoteArenaSession.cs @@ -1433,6 +1433,7 @@ namespace RustToDust.Net c.ThrottleCmd = nc.Throttle; c.SteerCmd = nc.Steer; c.MaxThermalRatio = nc.MaxThermalRatio; + c.Grid.ApplyReplicatedCoreHpRatio(nc.CoreHpRatio); c.X = nc.Pos.X; c.Y = nc.Pos.Y; c.Z = nc.Pos.Z; c.CurrRotX = nc.Rot.X; c.CurrRotY = nc.Rot.Y; c.CurrRotZ = nc.Rot.Z; c.CurrRotW = nc.Rot.W; c.VelX = nc.Vel.X; c.VelY = nc.Vel.Y; c.VelZ = nc.Vel.Z; diff --git a/src/RustToDust.Ymir/ArenaSession.cs b/src/RustToDust.Ymir/ArenaSession.cs index 902e343..2a7142b 100644 --- a/src/RustToDust.Ymir/ArenaSession.cs +++ b/src/RustToDust.Ymir/ArenaSession.cs @@ -2034,6 +2034,11 @@ namespace RustToDust.Ymir for (int i = 0; i < State.Spectators.Spectators.Count; i++) { _spectatorPvs[obs.Id, i] = false; + if (memState.SpectatorContacts.TryGetValue(State.Spectators.Spectators[i].Id, out var smem)) + { + smem.VisibleToPlayer = false; + smem.FaintHorizonPing = false; + } } continue; } diff --git a/tests/RustToDust.Tests/CultNetMultiplayerTests.cs b/tests/RustToDust.Tests/CultNetMultiplayerTests.cs index 7a862dc..20bf461 100644 --- a/tests/RustToDust.Tests/CultNetMultiplayerTests.cs +++ b/tests/RustToDust.Tests/CultNetMultiplayerTests.cs @@ -797,6 +797,40 @@ namespace RustToDust.Tests "Client must receive Exemplar walker snapshot even under dense 12 quad-walker contention"); } + [Fact] + public void RemoteArenaSession_AppliesRemoteContenderCoreHpRatioOnPvsSnapshot() + { + using var host = new ServerMatchHost(IPAddress.Loopback, 0, seed: 42, ArenaMapKind.Desert, maxHumans: 12, autoRestartSec: 0); + var ep = new IPEndPoint(IPAddress.Loopback, host.BoundPort); + + using var client = new RemoteArenaSession(ep, "HpProbe"); + long nowMs = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + Assert.True(PumpUntil(host, new[] { client }, () => client.IsJoined, ref nowMs, 3000)); + int localSlot = client.LocalContenderId; + int rivalSlot = localSlot == 0 ? 1 : 0; + + var serverLocal = host.Session.State.Contenders[localSlot]; + var serverRival = host.Session.State.Contenders[rivalSlot]; + host.Session.SetContenderPose(localSlot, 0f, 0f, 0f); + host.Session.SetContenderPose(rivalSlot, 0f, 40f, MathF.PI); + + float targetHp = serverRival.Grid.MaxCoreHp * 0.42f; + serverRival.Grid.ApplyReplicatedDamage(0, 0, 0f, 20f, targetHp, serverRival.Grid.HitSequence + 1); + float expectedRatio = serverRival.Grid.CoreHp / serverRival.Grid.MaxCoreHp; + + bool synced = PumpUntil(host, new[] { client }, () => + { + if (!client.IsContenderVisible(rivalSlot)) return false; + var c = client.ViewState.Contenders[rivalSlot]; + float r = c.Grid.MaxCoreHp > 0f ? c.Grid.CoreHp / c.Grid.MaxCoreHp : 1f; + return MathF.Abs(r - expectedRatio) < 0.02f; + }, ref nowMs, 2500); + + var clientRival = client.ViewState.Contenders[rivalSlot]; + float actualRatio = clientRival.Grid.MaxCoreHp > 0f ? clientRival.Grid.CoreHp / clientRival.Grid.MaxCoreHp : 1f; + Assert.True(synced, $"Expected remote contender {rivalSlot} CoreHpRatio ~ {expectedRatio:F3}, got {actualRatio:F3}"); + } + private static byte[] EncodeRudpLatestDatagram(byte[] frameBytes, uint sequence) => CultNetRudpPacketCodec.Encode(new CultNetRudpPacket { diff --git a/tests/RustToDust.Tests/DetectionLosTests.cs b/tests/RustToDust.Tests/DetectionLosTests.cs index 9bc5c4b..d56296e 100644 --- a/tests/RustToDust.Tests/DetectionLosTests.cs +++ b/tests/RustToDust.Tests/DetectionLosTests.cs @@ -584,5 +584,30 @@ namespace RustToDust.Tests Assert.Equal(0, targetNearest.TargetContenderId); } } + + [Fact] + public void DeadObserver_ClearsSpectatorContactsVisibleToPlayer() + { + using var session = new ArenaSession(seed: 12, slot0Human: true); + var player = session.State.Contenders[0]; + var spec = session.State.Spectators.Spectators.First(s => s.Alive); + + session.SetContenderPose(player.Id, 0f, 0f); + session.SetSpectatorPose(spec.Id, 0f, 35f); + session.State.Spectators.OnSpectatorDamaged(spec, player.Id); + + session.Step(); + var obs0 = session.State.GetOrCreateObserverState(0); + Assert.True(obs0.SpectatorContacts.TryGetValue(spec.Id, out var memBefore) && memBefore.VisibleToPlayer, + "Expected living observer in open LOS to mark provoked spectator VisibleToPlayer=true"); + + // Kill observer and step once; stale SpectatorContacts must clear VisibleToPlayer + player.Grid.ApplyReplicatedDamage(0, 0, 0f, 20f, 0f, player.Grid.HitSequence + 1); + Assert.False(player.Alive); + + session.Step(); + Assert.False(obs0.SpectatorContacts[spec.Id].VisibleToPlayer, + "Expected dead observer to clear SpectatorContacts.VisibleToPlayer"); + } } } diff --git a/tools/build_release.ps1 b/tools/build_release.ps1 index f12c601..0bf7e72 100644 --- a/tools/build_release.ps1 +++ b/tools/build_release.ps1 @@ -323,6 +323,12 @@ Write-Host "`n[3/5] Staging Release ymir_box3d.dll and runtime assets/..." Copy-Item -Path $ymirDllPath -Destination (Join-Path $StageDir "ymir_box3d.dll") -Force Copy-Item -Path $ymirDllPath -Destination (Join-Path $stagedDataDir "ymir_box3d.dll") -Force +$fontLicenseSrc = Join-Path $ClientDir "fonts\MONASPACE_LICENSE.txt" +if (-not (Test-Path $fontLicenseSrc)) { + throw "Required font license notice missing: '$fontLicenseSrc'." +} +Copy-Item -Path $fontLicenseSrc -Destination (Join-Path $StageDir "MONASPACE_LICENSE.txt") -Force + $stagedAssetsDir = Join-Path $StageDir "assets" $vCount = Copy-FilteredTree -SourceDir (Join-Path $AssetsSrcDir "vehicles") -DestDir (Join-Path $stagedAssetsDir "vehicles") -IncludeExtensions @(".glb", ".cc", ".json") $gCount = Copy-FilteredTree -SourceDir (Join-Path $AssetsSrcDir "gear") -DestDir (Join-Path $stagedAssetsDir "gear") -IncludeExtensions @(".glb")