fix(items): port retail useability and autowear rejection

Use the exact low USEABLE_NO-bit predicate so reset/zero-valued direct-use items such as Blackmoor's Favor reach the ordinary Use request. Port AutoWear's clothing-priority blocker lookup and exact named system notice through the shared activation owner.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-23 08:33:31 +02:00
parent 60387668d0
commit f71f947475
13 changed files with 289 additions and 57 deletions

View file

@ -310,6 +310,15 @@ public static class ItemUseability
public static uint TargetFlags(uint useability)
=> (useability & TargetMask) >> 16;
/// <summary>
/// Retail <c>ItemUses::IsUseable @ 0x004FCCC0</c>. The implementation
/// complements the full bitfield and returns its low bit, so only
/// <c>USEABLE_NO</c> disables use. In particular, the default
/// <c>USEABLE_UNDEF</c> value zero is usable.
/// </summary>
public static bool IsUseable(uint useability)
=> (useability & No) == 0;
/// <summary>
/// Retail <c>ItemUses::GetLeastLimitedTargetUse</c> (0x004fcd50): the most
/// permissive target-use bit present, priority Remote &gt; Viewed &gt;
@ -330,11 +339,7 @@ public static class ItemUseability
}
public static bool IsDirectUseable(uint useability)
{
uint source = SourceFlags(useability);
return !IsTargeted(useability)
&& (source & ~(No | NeverWalk)) != Undef;
}
=> !IsTargeted(useability) && IsUseable(useability);
}
/// <summary>