feat(D.5.1): thread CreateObject IconId into ItemRepository via spawn event

Added uint IconId = 0 (defaulted, last positional param) to the EntitySpawn
record so existing call sites outside WorldSession compile unchanged. The
WorldSession invoke now passes parsed.Value.IconId as the final arg.
OnLiveEntitySpawned calls Items.EnrichItem unconditionally — it's a no-op
for non-item spawns (players/NPCs/furniture aren't in the repo), so the call
is safe for every incoming CreateObject.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-16 21:54:48 +02:00
parent 998a0bd408
commit 5382d0a9d2
2 changed files with 9 additions and 2 deletions

View file

@ -80,7 +80,9 @@ public sealed class WorldSession : IDisposable
// sizing hint for tall-scenery selection indicators when the
// server publishes it for non-useable display entities.
uint? Useability = null,
float? UseRadius = null);
float? UseRadius = null,
// D.5.1: icon datId from CreateObject WeenieHeader, for toolbar rendering.
uint IconId = 0);
/// <summary>Fires when the session finishes parsing a CreateObject.</summary>
public event Action<EntitySpawn>? EntitySpawned;
@ -716,7 +718,8 @@ public sealed class WorldSession : IDisposable
parsed.Value.Friction,
parsed.Value.Elasticity,
parsed.Value.Useability,
parsed.Value.UseRadius));
parsed.Value.UseRadius,
parsed.Value.IconId));
}
}
else if (op == DeleteObject.Opcode)