From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 30 Apr 2025 07:49:36 +0000 (+1000) Subject: Fix examine prediction (#36999) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=feffbea9f97cb99ec8cf17da366cedd810c5d6e2;p=space-station-14.git 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. --- 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()