fix(inventory): complete switches on wield response
Clear retail AutoWield on the matching authoritative WieldObject instead of waiting for unrelated rollback bookkeeping to drain. This prevents a completed switch from consuming the next weapon activation locally, including crossbows. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
ea5cf5b842
commit
3e84027885
9 changed files with 47 additions and 21 deletions
|
|
@ -84,7 +84,7 @@ internal sealed class AutoWieldController : IDisposable
|
|||
_objects.ObjectMoved += OnObjectMoved;
|
||||
_objects.ObjectRemoved += OnObjectRemoved;
|
||||
_objects.MoveRequestFailed += OnMoveRequestFailed;
|
||||
_objects.MoveRequestConfirmed += OnMoveRequestConfirmed;
|
||||
_objects.WieldConfirmed += OnWieldConfirmed;
|
||||
_objects.Cleared += OnObjectsCleared;
|
||||
}
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ internal sealed class AutoWieldController : IDisposable
|
|||
TryWield(requested);
|
||||
}
|
||||
|
||||
private void OnMoveRequestConfirmed(ClientObject item)
|
||||
private void OnWieldConfirmed(ClientObject item)
|
||||
{
|
||||
if (_pendingSwitch is { BlockingItemId: 0 } pending
|
||||
&& item.ObjectId == pending.RequestedItemId)
|
||||
|
|
@ -319,7 +319,7 @@ internal sealed class AutoWieldController : IDisposable
|
|||
_objects.ObjectMoved -= OnObjectMoved;
|
||||
_objects.ObjectRemoved -= OnObjectRemoved;
|
||||
_objects.MoveRequestFailed -= OnMoveRequestFailed;
|
||||
_objects.MoveRequestConfirmed -= OnMoveRequestConfirmed;
|
||||
_objects.WieldConfirmed -= OnWieldConfirmed;
|
||||
_objects.Cleared -= OnObjectsCleared;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue