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

@ -166,7 +166,7 @@ public static class ItemInteractionPolicy
uint useability)
=> combatUse != 0
|| (type & ToolbarEquipmentTypes) != 0
|| (useability & ItemUseability.No) == 0;
|| ItemUseability.IsUseable(useability);
public static ItemPrimaryUseResult DetermineUseResult(
in ItemPolicyObject item,
@ -207,7 +207,7 @@ public static class ItemInteractionPolicy
return ItemPrimaryUseResult.BeginGame;
}
if (IsUseable(item.Useability))
if (ItemUseability.IsUseable(item.Useability))
return ItemPrimaryUseResult.ItemUse;
if (item.IsPlayer && item.Id != playerId)
@ -261,7 +261,7 @@ public static class ItemInteractionPolicy
return Consumed(actions);
}
if (IsUseable(source.Useability))
if (ItemUseability.IsUseable(source.Useability))
{
if ((source.Flags & PublicWeenieFlags.PlayerKillerSwitch) != 0)
return Consumed(new ItemPolicyAction(
@ -406,7 +406,7 @@ public static class ItemInteractionPolicy
if (item.OwnedByPlayer && item.IsContainer)
actions.Add(new ItemPolicyAction(ItemPolicyActionKind.OpenContainedContainer, item.Id));
if (!item.OwnedByPlayer && item.IsContainer
&& IsUseable(item.Useability)
&& ItemUseability.IsUseable(item.Useability)
&& !ItemUseability.IsTargeted(item.Useability))
actions.Add(new ItemPolicyAction(ItemPolicyActionKind.SetGroundObject, item.Id,
groundObjectId));
@ -418,10 +418,6 @@ public static class ItemInteractionPolicy
|| ((valid & ClothingLocations) != 0 && (current & ClothingLocations) == 0)
|| ((valid & HeldLocations) != 0 && (current & HeldLocations) == 0);
private static bool IsUseable(uint useability)
=> (ItemUseability.SourceFlags(useability)
& ~(ItemUseability.No | ItemUseability.NeverWalk)) != 0;
private static ItemPlacementPolicyDecision PlaceOnGround(
in ItemPlacementPolicyInput input)
{