Fixed some trivial runtime errors.

This commit is contained in:
genxium
2022-10-01 17:26:37 +08:00
parent a2a8be9068
commit cd83539197
5 changed files with 31 additions and 54 deletions

View File

@@ -1047,6 +1047,7 @@ cc.Class({
const inputList = self.getCachedInputFrameDownsyncWithPrediction(j).inputList;
for (let j in self.playerRichInfoArr) {
const joinIndex = parseInt(j) + 1;
const playerId = self.playerRichInfoArr[j].id;
const collisionPlayerIndex = self.collisionPlayerIndexPrefix + joinIndex;
const playerCollider = collisionSysMap.get(collisionPlayerIndex);
const player = renderFrame.players[playerId];

View File

@@ -166,6 +166,7 @@ window.initPersistentSessionClient = function(onopenCb, expectedRoomId) {
break;
case window.DOWNSYNC_MSG_ACT_FORCED_RESYNC:
if (window.handleInputFrameDownsyncBatch && window.handleRoomDownsyncFrame) {
console.warn("GOT forced resync:", resp);
// The following order of execution is important, because "handleInputFrameDownsyncBatch" is only available when state is IN_BATTLE
window.handleRoomDownsyncFrame(resp.rdf);
window.handleInputFrameDownsyncBatch(resp.inputFrameDownsyncBatch);