Fix examine prediction (#36999)
If our current ID is different to the received one we should just discard it even if it's for the same entity. Note that this doesn't quite fix my prediction issue as client and server are using slightly different timings for the event.
This commit is contained in:
parent
2ff8a45b58
commit
feffbea9f9
|
|
@ -37,7 +37,6 @@ namespace Content.Client.Examine
|
|||
public const string StyleClassEntityTooltip = "entity-tooltip";
|
||||
|
||||
private EntityUid _examinedEntity;
|
||||
private EntityUid _lastExaminedEntity;
|
||||
private Popup? _examineTooltipOpen;
|
||||
private ScreenCoordinates _popupPos;
|
||||
private CancellationTokenSource? _requestCancelTokenSource;
|
||||
|
|
@ -416,15 +415,14 @@ namespace Content.Client.Examine
|
|||
if (!IsClientSide(entity))
|
||||
{
|
||||
// Ask server for extra examine info.
|
||||
if (entity != _lastExaminedEntity)
|
||||
unchecked
|
||||
{
|
||||
_idCounter += 1;
|
||||
if (_idCounter == int.MaxValue)
|
||||
_idCounter = 0;
|
||||
}
|
||||
RaiseNetworkEvent(new ExamineSystemMessages.RequestExamineInfoMessage(GetNetEntity(entity), _idCounter, true));
|
||||
}
|
||||
|
||||
RaiseLocalEvent(entity, new ClientExaminedEvent(entity, playerEnt.Value));
|
||||
_lastExaminedEntity = entity;
|
||||
}
|
||||
|
||||
private void CloseTooltip()
|
||||
|
|
|
|||
Loading…
Reference in New Issue