From e264aab31b6cdc67d962600cb9b4fb9d5da1b9db Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Sun, 17 Sep 2023 14:22:47 +0300 Subject: fix netTick calculations --- pkg/messages/types/netTick.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/messages/types/netTick.go') diff --git a/pkg/messages/types/netTick.go b/pkg/messages/types/netTick.go index bd3464a..2870c9c 100644 --- a/pkg/messages/types/netTick.go +++ b/pkg/messages/types/netTick.go @@ -4,14 +4,14 @@ import "github.com/pektezol/bitreader" type NetTick struct { Tick int32 - HostFrameTime int16 - HostFrameTimeStdDeviation int16 + HostFrameTime float32 + HostFrameTimeStdDeviation float32 } func ParseNetTick(reader *bitreader.Reader) NetTick { return NetTick{ Tick: int32(reader.TryReadBits(32)), - HostFrameTime: int16(reader.TryReadBits(16) / 10e5), - HostFrameTimeStdDeviation: int16(reader.TryReadBits(16) / 10e5), + HostFrameTime: float32(reader.TryReadBits(16)) / 1e5, + HostFrameTimeStdDeviation: float32(reader.TryReadBits(16)) / 1e5, } } -- cgit v1.2.3