- d_protocol: Change horz/avel pack/unpacking from long to float.

This commit is contained in:
Mitchell Richters 2020-10-09 16:18:28 +11:00
parent 79cd5e4731
commit 9c993b9104

View file

@ -160,9 +160,9 @@ int UnpackUserCmd (InputPacket *ucmd, const InputPacket *basis, uint8_t **stream
if (flags & UCMDF_BUTTONS) if (flags & UCMDF_BUTTONS)
ucmd->actions = ESyncBits::FromInt(ReadLong(stream)); ucmd->actions = ESyncBits::FromInt(ReadLong(stream));
if (flags & UCMDF_PITCH) if (flags & UCMDF_PITCH)
ucmd->horz = ReadLong(stream); ucmd->horz = ReadFloat(stream);
if (flags & UCMDF_YAW) if (flags & UCMDF_YAW)
ucmd->avel = ReadLong(stream); ucmd->avel = ReadFloat(stream);
if (flags & UCMDF_FORWARDMOVE) if (flags & UCMDF_FORWARDMOVE)
ucmd->fvel = ReadWord (stream); ucmd->fvel = ReadWord (stream);
if (flags & UCMDF_SIDEMOVE) if (flags & UCMDF_SIDEMOVE)
@ -196,12 +196,12 @@ int PackUserCmd (const InputPacket *ucmd, const InputPacket *basis, uint8_t **st
if (ucmd->horz != basis->horz) if (ucmd->horz != basis->horz)
{ {
flags |= UCMDF_PITCH; flags |= UCMDF_PITCH;
WriteLong (ucmd->horz, stream); WriteFloat (ucmd->horz, stream);
} }
if (ucmd->avel != basis->avel) if (ucmd->avel != basis->avel)
{ {
flags |= UCMDF_YAW; flags |= UCMDF_YAW;
WriteLong (ucmd->avel, stream); WriteFloat (ucmd->avel, stream);
} }
if (ucmd->fvel != basis->fvel) if (ucmd->fvel != basis->fvel)
{ {