From 16e1d8a9134ffbae937a61f64a015462e39b9707 Mon Sep 17 00:00:00 2001 From: genxium Date: Mon, 27 Feb 2023 12:02:01 +0800 Subject: [PATCH] Minor fix. --- frontend/assets/scenes/login.fire | 2 +- frontend/assets/scripts/Map.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/assets/scenes/login.fire b/frontend/assets/scenes/login.fire index 3a227ba..ac65035 100644 --- a/frontend/assets/scenes/login.fire +++ b/frontend/assets/scenes/login.fire @@ -461,7 +461,7 @@ "array": [ 0, 0, - 209.57814771583418, + 210.43877906529718, 0, 0, 0, diff --git a/frontend/assets/scripts/Map.js b/frontend/assets/scripts/Map.js index f4978e3..12b2dd4 100644 --- a/frontend/assets/scripts/Map.js +++ b/frontend/assets/scripts/Map.js @@ -1012,7 +1012,8 @@ fromUDP=${fromUDP}`); const peerJoinIndexMask = (1 << (peerJoinIndex - 1)); self.getOrPrefabInputFrameUpsync(inputFrameId, false); // Make sure that inputFrame exists locally const existingInputFrame = gopkgs.GetInputFrameDownsync(self.recentInputCache, inputFrameId); - if (0 < (existingInputFrame.GetConfirmedList() & peerJoinIndexMask)) { + const existingConfirmedList = existingInputFrame.GetConfirmedList(); + if (0 < (existingConfirmedList & peerJoinIndexMask)) { continue; } if (inputFrameId > self.lastIndividuallyConfirmedInputFrameId[peerJoinIndex - 1]) { @@ -1021,9 +1022,10 @@ fromUDP=${fromUDP}`); } effCnt += 1; // the returned "gopkgs.NewInputFrameDownsync.InputList" is immutable, thus we can only modify the values in "newInputList" and "newConfirmedList"! + const existingInputList = existingInputFrame.GetInputList(); let newInputList = existingInputFrame.GetInputList().slice(); newInputList[peerJoinIndex - 1] = peerEncodedInput; - let newConfirmedList = (existingInputFrame.GetConfirmedList() | peerJoinIndexMask); + let newConfirmedList = (existingConfirmedList | peerJoinIndexMask); const newInputFrameDownsyncLocal = gopkgs.NewInputFrameDownsync(inputFrameId, newInputList, newConfirmedList); //console.log(`Updated encoded input of peerJoinIndex=${peerJoinIndex} to ${peerEncodedInput} for inputFrameId=${inputFrameId}/renderedInputFrameIdUpper=${renderedInputFrameIdUpper} from ${JSON.stringify(inputFrame)}; newInputFrameDownsyncLocal=${self.gopkgsInputFrameDownsyncStr(newInputFrameDownsyncLocal)}; existingInputFrame=${self.gopkgsInputFrameDownsyncStr(existingInputFrame)}`); self.recentInputCache.SetByFrameId(newInputFrameDownsyncLocal, inputFrameId); @@ -1034,7 +1036,7 @@ fromUDP=${fromUDP}`); if ( null == firstPredictedYetIncorrectInputFrameId && - existingInputFrame.InputList[peerJoinIndex - 1] != peerEncodedInput + existingInputList[peerJoinIndex - 1] != peerEncodedInput ) { firstPredictedYetIncorrectInputFrameId = inputFrameId; }