fix(interaction): bind selection to live incarnations
Carry local WorldEntity identity through render hits, lighting pulses, and deferred movement actions so GUID reuse cannot target a replacement. Reset all session-owned selection and ItemHolder state and prevent combat auto-target during teardown.
This commit is contained in:
parent
c271383714
commit
047a4c83b5
19 changed files with 374 additions and 42 deletions
|
|
@ -587,6 +587,24 @@ public sealed class ItemInteractionController : IDisposable
|
|||
StateChanged?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ends all session-scoped ItemHolder state. Target modes, click
|
||||
/// suppression, and use throttles must not survive a reconnect where the
|
||||
/// same numeric GUID can identify a different object.
|
||||
/// </summary>
|
||||
public void ResetSession()
|
||||
{
|
||||
bool busyChanged = _busyCount != 0;
|
||||
bool modeChanged = IsAnyTargetModeActive;
|
||||
_busyCount = 0;
|
||||
_lastUseMs = long.MinValue / 2;
|
||||
_consumedPrimaryClickTarget = 0u;
|
||||
_consumedPrimaryClickMs = long.MinValue / 2;
|
||||
_interactionState.Clear();
|
||||
if (busyChanged && !modeChanged)
|
||||
StateChanged?.Invoke();
|
||||
}
|
||||
|
||||
private bool ConsumeUseThrottle()
|
||||
{
|
||||
long now = _nowMs();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue