diff options
Diffstat (limited to 'Client/Assembly-CSharp/CustomNetworkTransform.cs')
-rw-r--r-- | Client/Assembly-CSharp/CustomNetworkTransform.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Client/Assembly-CSharp/CustomNetworkTransform.cs b/Client/Assembly-CSharp/CustomNetworkTransform.cs index 56113b1..5a15a11 100644 --- a/Client/Assembly-CSharp/CustomNetworkTransform.cs +++ b/Client/Assembly-CSharp/CustomNetworkTransform.cs @@ -58,13 +58,13 @@ public class CustomNetworkTransform : InnerNetObject public void Halt() { - ushort minSid = this.lastSequenceId + 1; + ushort minSid = (ushort)(this.lastSequenceId + 1); this.SnapTo(base.transform.position, minSid); } public void RpcSnapTo(Vector2 position) { - ushort minSid = this.lastSequenceId + 5; + ushort minSid = (ushort)(this.lastSequenceId + 5); if (AmongUsClient.Instance.AmClient) { this.SnapTo(position, minSid); @@ -77,7 +77,7 @@ public class CustomNetworkTransform : InnerNetObject public void SnapTo(Vector2 position) { - ushort minSid = this.lastSequenceId + 3; + ushort minSid = (ushort)(this.lastSequenceId + 3); this.SnapTo(position, minSid); } @@ -220,6 +220,7 @@ public class CustomNetworkTransform : InnerNetObject this.targetSyncPosition = this.ReadVector2(reader); this.targetSyncVelocity = this.ReadVector2(reader); // 当本地计算的位置数据和网络传输的位置数据差别大于snapThreshold的时候直接用消息里的位置和速度数据 + // 实际上是一种预测的策略 if (Vector2.Distance(this.body.position, this.targetSyncPosition) > this.snapThreshold) { if (this.body) @@ -240,7 +241,7 @@ public class CustomNetworkTransform : InnerNetObject private static bool SidGreaterThan(ushort newSid, ushort prevSid) { - ushort num = prevSid + 32767; + ushort num = (ushort)(prevSid + 32767); if (prevSid < num) { return newSid > prevSid && newSid <= num; |