From 5d717312cc055dc49e4b7f3c3f292fbad2c54133 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 3 May 2026 10:15:02 +0200 Subject: [PATCH] feat(net): plumb IsGrounded through EntityPositionUpdate (L.3.2 Task 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PositionFlags.IsGrounded (0x04) was already parsed by UpdatePosition but not exposed through the Parsed record or EntityPositionUpdate. Adds the bool field to both records so OnLivePositionUpdated can consume it for retail-faithful MoveOrTeleport routing (acclient @ 0x00516330: has_contact=false → no-op during airborne arc). Consumed in subsequent task (L.3.1+L.3.2 Task 3). Co-Authored-By: Claude Opus 4.7 --- src/AcDream.Core.Net/Messages/UpdatePosition.cs | 2 ++ src/AcDream.Core.Net/WorldSession.cs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/AcDream.Core.Net/Messages/UpdatePosition.cs b/src/AcDream.Core.Net/Messages/UpdatePosition.cs index cccfe4c..e4978cf 100644 --- a/src/AcDream.Core.Net/Messages/UpdatePosition.cs +++ b/src/AcDream.Core.Net/Messages/UpdatePosition.cs @@ -64,6 +64,7 @@ public static class UpdatePosition CreateObject.ServerPosition Position, System.Numerics.Vector3? Velocity, uint? PlacementId, + bool IsGrounded, ushort InstanceSequence = 0, ushort TeleportSequence = 0, ushort ForcePositionSequence = 0); @@ -164,6 +165,7 @@ public static class UpdatePosition RotationW: rw, RotationX: rx, RotationY: ry, RotationZ: rz); return new Parsed(guid, serverPos, velocity, placementId, + IsGrounded: (flags & PositionFlags.IsGrounded) != 0, instSeq, teleSeq, forceSeq); } catch diff --git a/src/AcDream.Core.Net/WorldSession.cs b/src/AcDream.Core.Net/WorldSession.cs index 47ef10b..3e76509 100644 --- a/src/AcDream.Core.Net/WorldSession.cs +++ b/src/AcDream.Core.Net/WorldSession.cs @@ -110,7 +110,8 @@ public sealed class WorldSession : IDisposable public readonly record struct EntityPositionUpdate( uint Guid, CreateObject.ServerPosition Position, - System.Numerics.Vector3? Velocity); + System.Numerics.Vector3? Velocity, + bool IsGrounded); /// /// Fires when the session parses a 0xF748 UpdatePosition game message. @@ -711,7 +712,8 @@ public sealed class WorldSession : IDisposable PositionUpdated?.Invoke(new EntityPositionUpdate( posUpdate.Value.Guid, posUpdate.Value.Position, - posUpdate.Value.Velocity)); + posUpdate.Value.Velocity, + posUpdate.Value.IsGrounded)); } } else if (op == VectorUpdate.Opcode)