mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-12-07 18:48:22 +00:00
Updated CUserCmd further.
This commit is contained in:
parent
c0af5a4ba6
commit
df20126b95
@ -132,6 +132,10 @@ void WriteUsercmd( bf_write *buf, const CUserCmd *to, const CUserCmd *from )
|
||||
WriteUserCmdDeltaFloat( buf, "viewangles[0]", from->viewangles[0], to->viewangles[0] );
|
||||
WriteUserCmdDeltaFloat( buf, "viewangles[1]", from->viewangles[1], to->viewangles[1] );
|
||||
WriteUserCmdDeltaFloat( buf, "viewangles[2]", from->viewangles[2], to->viewangles[2] );
|
||||
|
||||
WriteUserCmdDeltaFloat( buf, "aimdirection[0]", from->aimdirection[0], to->aimdirection[0] );
|
||||
WriteUserCmdDeltaFloat( buf, "aimdirection[1]", from->aimdirection[1], to->aimdirection[1] );
|
||||
WriteUserCmdDeltaFloat( buf, "aimdirection[2]", from->aimdirection[2], to->aimdirection[2] );
|
||||
|
||||
WriteUserCmdDeltaFloat( buf, "forwardmove", from->forwardmove, to->forwardmove );
|
||||
WriteUserCmdDeltaFloat( buf, "sidemove", from->sidemove, to->sidemove );
|
||||
@ -318,6 +322,22 @@ void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from )
|
||||
{
|
||||
move->viewangles[2] = buf->ReadFloat();
|
||||
}
|
||||
|
||||
// Read aim direction
|
||||
if ( buf->ReadOneBit() )
|
||||
{
|
||||
move->aimdirection[0] = buf->ReadFloat();
|
||||
}
|
||||
|
||||
if ( buf->ReadOneBit() )
|
||||
{
|
||||
move->aimdirection[1] = buf->ReadFloat();
|
||||
}
|
||||
|
||||
if ( buf->ReadOneBit() )
|
||||
{
|
||||
move->aimdirection[2] = buf->ReadFloat();
|
||||
}
|
||||
|
||||
// Read movement
|
||||
if ( buf->ReadOneBit() )
|
||||
|
||||
@ -43,6 +43,7 @@ public:
|
||||
command_number = 0;
|
||||
tick_count = 0;
|
||||
viewangles.Init();
|
||||
aimdirection.Init();
|
||||
forwardmove = 0.0f;
|
||||
sidemove = 0.0f;
|
||||
upmove = 0.0f;
|
||||
@ -88,6 +89,7 @@ public:
|
||||
command_number = src.command_number;
|
||||
tick_count = src.tick_count;
|
||||
viewangles = src.viewangles;
|
||||
aimdirection = src.aimdirection;
|
||||
forwardmove = src.forwardmove;
|
||||
sidemove = src.sidemove;
|
||||
upmove = src.upmove;
|
||||
@ -139,7 +141,8 @@ public:
|
||||
CRC32_Init( &crc );
|
||||
CRC32_ProcessBuffer( &crc, &command_number, sizeof( command_number ) );
|
||||
CRC32_ProcessBuffer( &crc, &tick_count, sizeof( tick_count ) );
|
||||
CRC32_ProcessBuffer( &crc, &viewangles, sizeof( viewangles ) );
|
||||
CRC32_ProcessBuffer( &crc, &viewangles, sizeof( viewangles ) );
|
||||
CRC32_ProcessBuffer( &crc, &aimdirection, sizeof( aimdirection ) );
|
||||
CRC32_ProcessBuffer( &crc, &forwardmove, sizeof( forwardmove ) );
|
||||
CRC32_ProcessBuffer( &crc, &sidemove, sizeof( sidemove ) );
|
||||
CRC32_ProcessBuffer( &crc, &upmove, sizeof( upmove ) );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user