Minor fix.

This commit is contained in:
genxium 2022-09-21 19:24:01 +08:00
parent f3428c88df
commit 6265d2bc1e
2 changed files with 4 additions and 3 deletions

View File

@ -363,8 +363,6 @@ module.export = cc.Class({
lateUpdate(dt) {
const self = this;
self.activeDirection.dx = self.activeDirection.dx;
self.activeDirection.dy = self.activeDirection.dy;
const now = new Date().getTime();
self.lastMovedAt = now;
},

View File

@ -338,7 +338,7 @@ cc.Class({
self.lastDownsyncInputFrameId = -1;
self.lastAllConfirmedInputFrameId = -1;
self.lastUpsyncInputFrameId = -1;
self.inputFrameUpsyncDelayTolerance = 1;
self.inputFrameUpsyncDelayTolerance = 3;
self.recentFrameCache = {};
self.recentFrameCacheCurrentSize = 0;
@ -964,6 +964,9 @@ cc.Class({
playerScriptIns.scheduleNewDirection(decodedInput, true);
if (invokeUpdateToo) {
playerScriptIns.update(self.rollbackEstimatedDt);
// [WARNING] CocosCreator v2.2.1 uses a singleton "CCDirector" to schedule "tree descendent updates" and "collision detections" in different timers, thus the following manual trigger of collision detection might not produce the same outcome for the "selfPlayer" as the other peers. Moreover, the aforementioned use of different timers is an intrinsic source of error!
cc.director._collisionManager.update(self.rollbackEstimatedDt); // Just to avoid unexpected wall penetration, no guarantee on determinism
}
}
},