From feffbea9f97cb99ec8cf17da366cedd810c5d6e2 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 30 Apr 2025 17:49:36 +1000 Subject: [PATCH] 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. --- Content.Client/Examine/ExamineSystem.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Content.Client/Examine/ExamineSystem.cs b/Content.Client/Examine/ExamineSystem.cs index 3aec394324..9f0496e578 100644 --- a/Content.Client/Examine/ExamineSystem.cs +++ b/Content.Client/Examine/ExamineSystem.cs @@ -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() -- 2.51.2