Send interpolated_amount
This commit is contained in:
parent
1e82d50c88
commit
399e6e674a
2 changed files with 25 additions and 4 deletions
|
@ -137,8 +137,11 @@ void FX_FireBullets(
|
|||
CCSPlayer *pPlayer = ToCSPlayer( UTIL_PlayerByIndex( iPlayerIndex) );
|
||||
#endif
|
||||
|
||||
// DevMsg("original shoot pos: %f %f %f\n", vHookedOrigin.x, vHookedOrigin.y, vHookedOrigin.z );
|
||||
|
||||
// #ifndef CLIENT_DLL
|
||||
// DevMsg("server original shoot pos: %f %f %f\n", vHookedOrigin.x, vHookedOrigin.y, vHookedOrigin.z );
|
||||
// #else
|
||||
// DevMsg("client original shoot pos: %f %f %f\n", vHookedOrigin.x, vHookedOrigin.y, vHookedOrigin.z );
|
||||
// #endif
|
||||
CUserCmd* playerCmd = NULL;
|
||||
|
||||
if (pPlayer)
|
||||
|
@ -155,8 +158,11 @@ void FX_FireBullets(
|
|||
vHookedOrigin = VectorLerp(pPlayer->m_vecPreviousShootPosition, vOrigin, playerCmd->interpolated_amount);
|
||||
}
|
||||
|
||||
// DevMsg("new shoot pos: %f %f %f, has command: %s\n", vHookedOrigin.x, vHookedOrigin.y, vHookedOrigin.z, playerCmd ? "true" : "false" );
|
||||
|
||||
// #ifndef CLIENT_DLL
|
||||
// DevMsg("server new shoot pos: %f %f %f - %f, has command: %s\n", vHookedOrigin.x, vHookedOrigin.y, vHookedOrigin.z, playerCmd->interpolated_amount, playerCmd ? "true" : "false" );
|
||||
// #else
|
||||
// DevMsg("client new shoot pos: %f %f %f - %f, has command: %s\n", vHookedOrigin.x, vHookedOrigin.y, vHookedOrigin.z, playerCmd->interpolated_amount, playerCmd ? "true" : "false" );
|
||||
// #endif
|
||||
const char * weaponAlias = WeaponIDToAlias( iWeaponID );
|
||||
|
||||
if ( !weaponAlias )
|
||||
|
|
|
@ -226,6 +226,16 @@ void WriteUsercmd( bf_write *buf, const CUserCmd *to, const CUserCmd *from )
|
|||
buf->WriteOneBit(0);
|
||||
}
|
||||
|
||||
if (from->interpolated_amount != to->interpolated_amount)
|
||||
{
|
||||
buf->WriteOneBit(1);
|
||||
buf->WriteBitFloat(to->interpolated_amount);
|
||||
}
|
||||
else
|
||||
{
|
||||
buf->WriteOneBit(0);
|
||||
}
|
||||
|
||||
#if defined( HL2_CLIENT_DLL )
|
||||
if ( to->entitygroundcontact.Count() != 0 )
|
||||
{
|
||||
|
@ -365,6 +375,11 @@ void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from )
|
|||
move->debug_hitboxes = (CUserCmd::debug_hitboxes_t)buf->ReadUBitLong(2);
|
||||
}
|
||||
|
||||
if ( buf->ReadOneBit() )
|
||||
{
|
||||
move->interpolated_amount = buf->ReadBitFloat();
|
||||
}
|
||||
|
||||
#if defined( HL2_DLL )
|
||||
if ( buf->ReadOneBit() )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue