From c5c636674d761b26daec2c198c44067f83ceab5e Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 22 Jun 2026 22:18:10 +0200 Subject: [PATCH] =?UTF-8?q?docs(D.2b):=20IsCarriedBy=20=E2=80=94=20note=20?= =?UTF-8?q?WielderId=20is=20wire-only;=20optimistic=20wields=20detected=20?= =?UTF-8?q?via=20ContainerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code-review minor: prevents a future WielderId-only 'is this wielded?' check from silently missing an optimistically-wielded item (WielderId==0 until the server confirm; ContainerId==wielder is the live signal). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/AcDream.Core/Items/ClientObjectTable.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AcDream.Core/Items/ClientObjectTable.cs b/src/AcDream.Core/Items/ClientObjectTable.cs index 48893182..a80b0fb2 100644 --- a/src/AcDream.Core/Items/ClientObjectTable.cs +++ b/src/AcDream.Core/Items/ClientObjectTable.cs @@ -482,6 +482,10 @@ public sealed class ClientObjectTable return total; } + // NOTE: WielderId is populated from wire data only (CreateObject → Ingest). An + // optimistically-wielded item (WieldItemOptimistic, before the server confirm) has + // WielderId == 0 and is detected via the ContainerId walk below (ContainerId == wielder). + // A future "is this wielded by me?" check must therefore use ContainerId, NOT WielderId alone. private bool IsCarriedBy(ClientObject o, uint ownerGuid) { if (o.WielderId == ownerGuid) return true;