NetworkTransformUnreliable: syntax (early returns)

This commit is contained in:
vis2k 2023-03-14 17:18:27 +08:00
parent 5f1ec83cca
commit 69de3f0379

View File

@ -134,8 +134,8 @@ void UpdateServerInterpolation()
connectionToClient != null &&
!isOwned)
{
if (serverSnapshots.Count > 0)
{
if (serverSnapshots.Count == 0) return;
// step the transform interpolation without touching time.
// NetworkClient is responsible for time globally.
SnapshotInterpolation.StepInterpolation(
@ -150,7 +150,6 @@ void UpdateServerInterpolation()
Apply(computed, to);
}
}
}
void UpdateServer()
{
@ -230,8 +229,8 @@ void UpdateClientBroadcast()
void UpdateClientInterpolation()
{
// only while we have snapshots
if (clientSnapshots.Count > 0)
{
if (clientSnapshots.Count == 0) return;
// step the interpolation without touching time.
// NetworkClient is responsible for time globally.
SnapshotInterpolation.StepInterpolation(
@ -245,7 +244,6 @@ void UpdateClientInterpolation()
TransformSnapshot computed = TransformSnapshot.Interpolate(from, to, t);
Apply(computed, to);
}
}
void UpdateClient()
{