mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-20 12:36:05 +08:00
Updated CUserCmd further.
This commit is contained in:
@ -133,6 +133,10 @@ void WriteUsercmd( bf_write *buf, const CUserCmd *to, const CUserCmd *from )
|
|||||||
WriteUserCmdDeltaFloat( buf, "viewangles[1]", from->viewangles[1], to->viewangles[1] );
|
WriteUserCmdDeltaFloat( buf, "viewangles[1]", from->viewangles[1], to->viewangles[1] );
|
||||||
WriteUserCmdDeltaFloat( buf, "viewangles[2]", from->viewangles[2], to->viewangles[2] );
|
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, "forwardmove", from->forwardmove, to->forwardmove );
|
||||||
WriteUserCmdDeltaFloat( buf, "sidemove", from->sidemove, to->sidemove );
|
WriteUserCmdDeltaFloat( buf, "sidemove", from->sidemove, to->sidemove );
|
||||||
WriteUserCmdDeltaFloat( buf, "upmove", from->upmove, to->upmove );
|
WriteUserCmdDeltaFloat( buf, "upmove", from->upmove, to->upmove );
|
||||||
@ -319,6 +323,22 @@ void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from )
|
|||||||
move->viewangles[2] = buf->ReadFloat();
|
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
|
// Read movement
|
||||||
if ( buf->ReadOneBit() )
|
if ( buf->ReadOneBit() )
|
||||||
{
|
{
|
||||||
|
@ -43,6 +43,7 @@ public:
|
|||||||
command_number = 0;
|
command_number = 0;
|
||||||
tick_count = 0;
|
tick_count = 0;
|
||||||
viewangles.Init();
|
viewangles.Init();
|
||||||
|
aimdirection.Init();
|
||||||
forwardmove = 0.0f;
|
forwardmove = 0.0f;
|
||||||
sidemove = 0.0f;
|
sidemove = 0.0f;
|
||||||
upmove = 0.0f;
|
upmove = 0.0f;
|
||||||
@ -88,6 +89,7 @@ public:
|
|||||||
command_number = src.command_number;
|
command_number = src.command_number;
|
||||||
tick_count = src.tick_count;
|
tick_count = src.tick_count;
|
||||||
viewangles = src.viewangles;
|
viewangles = src.viewangles;
|
||||||
|
aimdirection = src.aimdirection;
|
||||||
forwardmove = src.forwardmove;
|
forwardmove = src.forwardmove;
|
||||||
sidemove = src.sidemove;
|
sidemove = src.sidemove;
|
||||||
upmove = src.upmove;
|
upmove = src.upmove;
|
||||||
@ -140,6 +142,7 @@ public:
|
|||||||
CRC32_ProcessBuffer( &crc, &command_number, sizeof( command_number ) );
|
CRC32_ProcessBuffer( &crc, &command_number, sizeof( command_number ) );
|
||||||
CRC32_ProcessBuffer( &crc, &tick_count, sizeof( tick_count ) );
|
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, &forwardmove, sizeof( forwardmove ) );
|
||||||
CRC32_ProcessBuffer( &crc, &sidemove, sizeof( sidemove ) );
|
CRC32_ProcessBuffer( &crc, &sidemove, sizeof( sidemove ) );
|
||||||
CRC32_ProcessBuffer( &crc, &upmove, sizeof( upmove ) );
|
CRC32_ProcessBuffer( &crc, &upmove, sizeof( upmove ) );
|
||||||
|
Reference in New Issue
Block a user