fix(items): dispatch carried use without world approach
This commit is contained in:
parent
f71f947475
commit
19e8863f4e
7 changed files with 99 additions and 18 deletions
|
|
@ -211,6 +211,18 @@ internal sealed class SelectionInteractionController
|
|||
reservation?.CancelBeforeDispatch();
|
||||
return;
|
||||
}
|
||||
|
||||
// ItemHolder::UseObject @ 0x00588A80 sends Event_UseEvent for an
|
||||
// accepted carried-item activation before CPlayerSystem::UsingItem.
|
||||
// A carried source has no world pose to approach: routing it through
|
||||
// TryGetApproach drops the packet because inventory objects are not
|
||||
// live spatial entities.
|
||||
if (_items.IsOwnedByPlayer(serverGuid))
|
||||
{
|
||||
SendUseNow(serverGuid, reservation);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_query.IsUseable(serverGuid)
|
||||
|| !_query.TryGetApproach(serverGuid, out InteractionApproach approach))
|
||||
{
|
||||
|
|
@ -240,15 +252,21 @@ internal sealed class SelectionInteractionController
|
|||
}
|
||||
|
||||
_movement.BeginApproach(approach);
|
||||
SendUseNow(serverGuid, reservation);
|
||||
}
|
||||
|
||||
private void SendUseNow(
|
||||
uint serverGuid,
|
||||
ItemUseRequestReservation? reservation)
|
||||
{
|
||||
if (_transport.TrySendUse(serverGuid, out uint sequence))
|
||||
{
|
||||
reservation?.MarkDispatched();
|
||||
Console.WriteLine($"[B.4b] use guid=0x{serverGuid:X8} seq={sequence}");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
reservation?.CancelBeforeDispatch();
|
||||
}
|
||||
|
||||
reservation?.CancelBeforeDispatch();
|
||||
}
|
||||
|
||||
public void SendPickup(uint itemGuid, uint destinationContainerId, int placement)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue