From b0f37d22376bfe24d7cfbc3c7f0083e103fd88f8 Mon Sep 17 00:00:00 2001 From: genxium Date: Wed, 1 Feb 2023 23:41:08 +0800 Subject: [PATCH] Minor update. --- frontend/assets/scripts/NetworkDoctor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/assets/scripts/NetworkDoctor.js b/frontend/assets/scripts/NetworkDoctor.js index 4e95f6b..2f44ae6 100644 --- a/frontend/assets/scripts/NetworkDoctor.js +++ b/frontend/assets/scripts/NetworkDoctor.js @@ -97,7 +97,7 @@ NetworkDoctor.prototype.isTooFast = function(mapIns) { if (mapIns.lastIndividuallyConfirmedInputFrameId[k] >= minInputFrameIdFront) continue; minInputFrameIdFront = mapIns.lastIndividuallyConfirmedInputFrameId[k]; } - if ((selfInputFrameIdFront > minInputFrameIdFront) && ((selfInputFrameIdFront - minInputFrameIdFront) > (mapIns.inputFrameUpsyncDelayTolerance >> 1))) { + if ((selfInputFrameIdFront > minInputFrameIdFront) && ((selfInputFrameIdFront - minInputFrameIdFront) > (mapIns.inputFrameUpsyncDelayTolerance + 1))) { // first comparison condition is to avoid numeric overflow console.log(`Game logic ticking too fast, selfInputFrameIdFront=${selfInputFrameIdFront}, minInputFrameIdFront=${minInputFrameIdFront}, inputFrameUpsyncDelayTolerance=${mapIns.inputFrameUpsyncDelayTolerance}`); return true;