- InputPacket: Change fvel/svel from int16_t to int32_t to accommodate larger fvel/svel from Witchaven.

This commit is contained in:
Mitchell Richters 2020-11-08 17:00:52 +11:00
parent 6dd2f31156
commit 6371505fb3
2 changed files with 6 additions and 6 deletions

View file

@ -164,9 +164,9 @@ int UnpackUserCmd (InputPacket *ucmd, const InputPacket *basis, uint8_t **stream
if (flags & UCMDF_YAW)
ucmd->avel = ReadFloat(stream);
if (flags & UCMDF_FORWARDMOVE)
ucmd->fvel = ReadWord (stream);
ucmd->fvel = ReadLong (stream);
if (flags & UCMDF_SIDEMOVE)
ucmd->svel = ReadWord (stream);
ucmd->svel = ReadLong (stream);
}
return int(*stream - start);
@ -206,12 +206,12 @@ int PackUserCmd (const InputPacket *ucmd, const InputPacket *basis, uint8_t **st
if (ucmd->fvel != basis->fvel)
{
flags |= UCMDF_FORWARDMOVE;
WriteWord (ucmd->fvel, stream);
WriteLong (ucmd->fvel, stream);
}
if (ucmd->svel != basis->svel)
{
flags |= UCMDF_SIDEMOVE;
WriteWord (ucmd->svel, stream);
WriteLong (ucmd->svel, stream);
}
// Write the packing bits

View file

@ -74,8 +74,8 @@ enum
struct InputPacket
{
int16_t svel;
int16_t fvel;
int32_t svel;
int32_t fvel;
float avel;
float horz;
ESyncBits actions;