feat(net+app): Phase 6.3 — extract server MotionTableId and use as resolver override

The Foundry's drudge statue Setup (0x020007DD) has DefaultMotionTable=0,
so MotionResolver returned null and the renderer fell back to
PlacementFrames[Default] — an upright pose, which is wrong. The retail
crouched/aggressive pose comes from a per-instance motion table the
server attaches via PhysicsDescriptionFlag.MTable (confirmed live as
0x090000DA for the statue).

CreateObject.TryParse was already walking the MTable field but
discarding the value. Now it captures it as Parsed.MotionTableId and
WorldSession.EntitySpawn forwards it. GameWindow passes it as the
motionTableIdOverride to MotionResolver.GetIdleFrame, so the cycle
lookup uses the server-supplied table when the dat-side default is
empty. With this in place the drudge resolves a real cycle and
renders in the correct crouched pose.

Trimmed the heavy STATUE motion-table dump diagnostics now that the
mechanism is verified; left a one-line summary so future regressions
remain debuggable. 160 tests green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-04-11 19:03:00 +02:00
parent 120e801ecf
commit b96167e066
3 changed files with 18 additions and 7 deletions

View file

@ -91,7 +91,8 @@ public static class CreateObject
uint? BasePaletteId,
float? ObjScale,
string? Name,
ServerMotionState? MotionState);
ServerMotionState? MotionState,
uint? MotionTableId);
/// <summary>
/// The relevant subset of the server-sent <c>MovementData</c> /
@ -156,6 +157,7 @@ public static class CreateObject
uint? setupTableId = null;
float? objScale = null;
ServerMotionState? motionState = null;
uint? motionTableId = null;
try
{
@ -274,6 +276,7 @@ public static class CreateObject
if ((physicsFlags & PhysicsDescriptionFlag.MTable) != 0)
{
if (body.Length - pos < 4) return null;
motionTableId = BinaryPrimitives.ReadUInt32LittleEndian(body.Slice(pos));
pos += 4;
}
@ -346,13 +349,13 @@ public static class CreateObject
}
return new Parsed(guid, position, setupTableId, animParts,
textureChanges, subPalettes, basePaletteId, objScale, name, motionState);
textureChanges, subPalettes, basePaletteId, objScale, name, motionState, motionTableId);
// Local helper: if we ran out of fields past PhysicsData, still
// return the useful prefix (guid/position/setup/animParts/textures/palettes/scale/motion).
Parsed PartialResult() => new(
guid, position, setupTableId, animParts,
textureChanges, subPalettes, basePaletteId, objScale, null, motionState);
textureChanges, subPalettes, basePaletteId, objScale, null, motionState, motionTableId);
}
catch
{

View file

@ -52,7 +52,8 @@ public sealed class WorldSession : IDisposable
uint? BasePaletteId,
float? ObjScale,
string? Name,
CreateObject.ServerMotionState? MotionState);
CreateObject.ServerMotionState? MotionState,
uint? MotionTableId);
/// <summary>Fires when the session finishes parsing a CreateObject.</summary>
public event Action<EntitySpawn>? EntitySpawned;
@ -238,7 +239,8 @@ public sealed class WorldSession : IDisposable
parsed.Value.BasePaletteId,
parsed.Value.ObjScale,
parsed.Value.Name,
parsed.Value.MotionState));
parsed.Value.MotionState,
parsed.Value.MotionTableId));
}
}
}