fix(interaction): port retail's wielded-item pickup rejection (Slice 4 F1)
Slice 4 made a remote character's wielded weapon selectable, which made the
pickup chain reachable end to end for the first time: SelectionPickUp on
another player's weapon captured identity, passed ValidatePickupTarget (which
checked only the Stuck flag and the small-item mask, and a MeleeWeapon clears
both), installed a real non-autonomous approach through
PlayerInteractionMovementSink, and then sent a pickup request the server
rejects. Retail does none of that.
ItemHolder::AttemptToPlaceInContainer @ 0x00588140 runs
AttemptToPlaceInContainer_IsItemLegal @ 0x005870C0 first, at 0x00588173 --
ahead of container legality, auto-merge, the container walk, and the only
CM_Inventory::Event_PutItemInContainer emitter
(ACCWeenieObject::UIAttemptPutInContainer @ 0x0058D680). IsItemLegal's arm at
0x005872B7 rejects `!ACCWeenieObject::IsOwnedByPlayer(item) &&
item->pwd._location != 0` with one local
ECM_UI::SendNotice_DisplayStringInfo(0x1a, ...), and
CPlayerSystem::PlaceInBackpack @ 0x0055D8C0 then withdraws the waiting slot it
had published (SetWaitingState(obj, 0) + SendNotice_EndPendingInPlayer at
0x0055D918). No request, no movement. acdream had never ported that arm; it
was harmless while wielded children were unpickable and stopped being harmless
at f6db964f.
The notice is data_7e2228, "The %s is being wielded by someone else!" -- WITH
the exclamation mark. IsItemLegal's six strings occupy one contiguous literal
block, 0x007e21f0 through 0x007e234c, one per arm in reverse code order, and
the two neighbours already ported here (0x007e227c "The %s cannot be picked
up!" at 0x00587264, 0x007e22b4 "You cannot pick up creatures!" at 0x005871f4)
pin it. The punctuation-free 0x007cd350 variant belongs to the wield/wear
block and is emitted from a different function at 0x00560aef.
pwd._location is the PublicWeenieDesc CurrentWieldedLocation field
(acclient.h:37175), which acdream projects as
ClientObject.CurrentlyEquippedLocation, and ACCWeenieObject::IsOwnedByPlayer
@ 0x0058D160 is IsOwnedByObject(this, player_id) -- already ported as
ClientObjectTable.IsOwnedByObject @ 0x0058CEB0 and reached here through the
existing ItemInteractionController.IsOwnedByPlayer. The arm reads pwd._location
verbatim rather than adding a WielderId belt-and-braces test, because retail's
predicate is the thing being ported.
The player's OWN wielded item is IsOwnedByPlayer, so retail passes it and takes
a different route. ACCWeenieObject::DeterminePositionState @ 0x0058BE70 gives
it PositionState.WIELDED (acclient.h:6802) rather than IN_3D_VIEW, and
UIAttemptPutInContainer records IR_PICK_UP only for IN_3D_VIEW, treating
WIELDED and IN_CONTAINER alike as a plain IR_PUT_IN_CONTAINER transfer. So an
own-wielded item is unwielded in place: the request goes out immediately with
no approach, joining the existing current-ground-object shortcut. The shortcut
carries an ownership conjunct so it can never outrun the 0x005872B7 gate.
TryGetApproach now refuses attached children outright, for the same
IN_3D_VIEW reason. An Attached projection's bookkeeping WorldEntity.Position
carries the PARENT's composed root (EquippedChildRenderController
.ApplyParentWorldPose), not the child frame CPhysicsObj::UpdateChild @
0x00512D50 composes, so an approach built from it walked toward the wielder.
Slice 4 de-parented the marker anchor but left this one parent-derived; no
approach can anchor on a wielder now.
The pick predicates are deliberately untouched. Picking, selecting, examining,
lighting-pulse identity, and the vivid-marker anchor on a remote's wielded
weapon all behave exactly as Slice 4 shipped them -- retail's sr_Select and
sr_Examine branches of RecvNotice_SmartBoxObjectFound @ 0x004E5AD0 never
consult IsItemLegal. The gate is the transaction, not the pick.
f6db964f's message asserted the slice introduced no deviation and owed no
retail-divergence-register row. That was wrong: the unported 0x005872B7 arm
was a deviation it made reachable. This commit ports the arm in full, matches
retail on the own-wielded path, and removes the parent-derived approach
anchor, so the record is corrected here and no register row is owed.
Gates: dotnet build green; AcDream.App.Tests 3,960 passed / 3 skipped;
complete Release solution 9,792 passed / 5 skipped;
tools\run-connected-world-lifecycle-gate.ps1 -SkipBuild RESULT=PASS.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
f6db964fd5
commit
0ccbb4e52c
8 changed files with 442 additions and 5 deletions
|
|
@ -255,7 +255,17 @@ internal sealed class SelectionInteractionController
|
|||
// current-ground-object contents straight to
|
||||
// ItemHolder::AttemptToPlaceInContainer @ 0x00588140. A corpse or
|
||||
// chest child has no independent 3-D projection to approach.
|
||||
if (_items.IsInCurrentGroundObject(itemGuid))
|
||||
//
|
||||
// ACCWeenieObject::UIAttemptPutInContainer @ 0x0058D680 records the
|
||||
// IR_PICK_UP world request only for PositionState.IN_3D_VIEW and
|
||||
// treats WIELDED as a plain IR_PUT_IN_CONTAINER transfer, so the
|
||||
// player's own wielded item is unwielded in place with no approach.
|
||||
// The ownership conjunct keeps this shortcut behind IsItemLegal's
|
||||
// 0x005872B7 arm, which ValidatePickupTarget enforces below: a wielded
|
||||
// item that is not the player's must never reach a wire request.
|
||||
if (_items.IsInCurrentGroundObject(itemGuid)
|
||||
|| (_query.IsWieldedPositionState(itemGuid)
|
||||
&& _items.IsOwnedByPlayer(itemGuid)))
|
||||
{
|
||||
var contained = new RuntimePendingPickup(
|
||||
Token: 0u,
|
||||
|
|
@ -505,6 +515,20 @@ internal sealed class SelectionInteractionController
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <c>ItemHolder::AttemptToPlaceInContainer @ 0x00588140</c> runs
|
||||
/// <c>AttemptToPlaceInContainer_IsItemLegal @ 0x005870C0</c> first, at
|
||||
/// <c>0x00588173</c> — ahead of container legality, auto-merge, the
|
||||
/// container walk, and the only <c>CM_Inventory::Event_PutItemInContainer</c>
|
||||
/// emitter (<c>ACCWeenieObject::UIAttemptPutInContainer @ 0x0058D680</c>).
|
||||
/// A rejection is therefore one local
|
||||
/// <c>ECM_UI::SendNotice_DisplayStringInfo(0x1a, …)</c> and nothing else:
|
||||
/// no wire request and no movement.
|
||||
/// <c>CPlayerSystem::PlaceInBackpack @ 0x0055D8C0</c> then withdraws the
|
||||
/// waiting slot it had published (<c>SetWaitingState(obj, 0)</c> plus
|
||||
/// <c>CM_Item::SendNotice_EndPendingInPlayer</c> at <c>0x0055D918</c>),
|
||||
/// which is what a <c>false</c> return drives here.
|
||||
/// </summary>
|
||||
private bool ValidatePickupTarget(uint serverGuid, bool showToast)
|
||||
{
|
||||
if (_query.IsCreature(serverGuid))
|
||||
|
|
@ -513,6 +537,24 @@ internal sealed class SelectionInteractionController
|
|||
_toast?.Invoke(RetailMessages.CannotPickUpCreatures);
|
||||
return false;
|
||||
}
|
||||
// IsItemLegal's arm at 0x005872B7 rejects
|
||||
// `!ACCWeenieObject::IsOwnedByPlayer(item) && item->pwd._location != 0`
|
||||
// with the notice at 0x005872DB. Retail runs it after the stuck arm at
|
||||
// 0x00587240; the two are disjoint, because the stuck arm fires only
|
||||
// when _containerID and _wielderID are both zero while this one needs a
|
||||
// wielded _location, so acdream's fused stuck/type predicate may follow.
|
||||
// Equipped-child picking made a remote character's wielded item
|
||||
// selectable, which is what makes this arm reachable.
|
||||
if (_query.IsWieldedPositionState(serverGuid)
|
||||
&& !_items.IsOwnedByPlayer(serverGuid))
|
||||
{
|
||||
if (showToast)
|
||||
{
|
||||
_toast?.Invoke(RetailMessages.BeingWieldedBySomeoneElse(
|
||||
_query.Describe(serverGuid)));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (_query.IsPickupable(serverGuid))
|
||||
return true;
|
||||
if (showToast)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue