feat(D.5.1): capture IconId in CreateObject.Parsed (was discarded at cs:516)

ReadPackedDwordOfKnownType at the old line 516 was throwing the icon dat
id away. Declare iconId before the try-block, assign it there, and pass
IconId: iconId in the Parsed initializer so downstream UI (action bar /
equipment panels) can read the 0x06xxxxxx dat id without a separate lookup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-16 21:44:01 +02:00
parent 30b28c248a
commit da171cb4e3
2 changed files with 36 additions and 4 deletions

View file

@ -127,6 +127,12 @@ public static class CreateObject
// defaults (0.05f elasticity, 0.5f friction).
float? Friction = null,
float? Elasticity = null,
// D.5.1 (2026-06-16): icon dat id (0x06xxxxxx) from the WeenieHeader
// fixed prefix. Previously discarded at cs:516; surfaced so the action
// bar / equipment UI can display the correct icon sprite without a
// separate dat lookup. Zero means "not sent" (packed zero sentinel in
// ReadPackedDwordOfKnownType preserves 0 as-is).
uint IconId = 0,
// 2026-05-15: optional WeenieHeader tail. The retail
// `ITEM_USEABLE _useability` (acclient.h:6478) — gates whether the
// R-key Use action does anything. <c>(Useability &amp; USEABLE_REMOTE
@ -506,6 +512,7 @@ public static class CreateObject
string? name = null;
uint? itemType = null;
uint weenieFlags = 0;
uint iconId = 0;
if (body.Length - pos >= 4)
{
weenieFlags = ReadU32(body, ref pos);
@ -513,7 +520,7 @@ public static class CreateObject
{
name = ReadString16L(body, ref pos);
_ = ReadPackedDword(body, ref pos); // WeenieClassId
_ = ReadPackedDwordOfKnownType(body, ref pos, IconTypePrefix);
iconId = ReadPackedDwordOfKnownType(body, ref pos, IconTypePrefix);
if (body.Length - pos >= 4)
itemType = ReadU32(body, ref pos);
if (body.Length - pos >= 4)
@ -611,7 +618,8 @@ public static class CreateObject
instanceSeq, teleportSeq, serverControlSeq, forcePositionSeq,
physicsState, objectDescriptionFlags,
friction, elasticity,
useability, useRadius);
IconId: iconId,
Useability: useability, UseRadius: useRadius);
// Local helper: if we ran out of fields past PhysicsData, still
// return the useful prefix (guid/position/setup/animParts/textures/palettes/scale/motion).