vecSrc bullet should be taken into an array

This commit is contained in:
Kamay Xutax 2024-07-16 00:19:52 +02:00
parent 37cfbaad88
commit 50298946f8
7 changed files with 7 additions and 30 deletions

View file

@ -249,7 +249,7 @@ END_RECV_TABLE()
RecvPropFloat ( RECVINFO( m_flLaggedMovementValue )), RecvPropFloat ( RECVINFO( m_flLaggedMovementValue )),
RecvPropArray3 ( RECVINFO_ARRAY(m_vecBulletServerPositions), RecvPropVector( RECVINFO(m_vecBulletServerPositions[0])) ), RecvPropArray3 ( RECVINFO_ARRAY(m_vecBulletServerPositions), RecvPropVector( RECVINFO(m_vecBulletServerPositions[0])) ),
RecvPropInt(RECVINFO(m_iBulletServerPositionCount)), RecvPropInt(RECVINFO(m_iBulletServerPositionCount)),
RecvPropVector(RECVINFO(m_vecServerShootPosition)), RecvPropArray3 ( RECVINFO_ARRAY(m_vecServerShootPosition), RecvPropVector( RECVINFO(m_vecServerShootPosition[0])) ),
END_RECV_TABLE() END_RECV_TABLE()

View file

@ -642,7 +642,7 @@ public:
int m_nTickBaseFireBullet; int m_nTickBaseFireBullet;
Vector m_vecBulletServerPositions[MAX_PLAYER_BULLET_SERVER_POSITIONS]; Vector m_vecBulletServerPositions[MAX_PLAYER_BULLET_SERVER_POSITIONS];
int m_iBulletServerPositionCount; int m_iBulletServerPositionCount;
Vector m_vecServerShootPosition; Vector m_vecServerShootPosition[MAX_PLAYER_BULLET_SERVER_POSITIONS];
}; };
EXTERN_RECV_TABLE(DT_BasePlayer); EXTERN_RECV_TABLE(DT_BasePlayer);

View file

@ -2241,7 +2241,7 @@ void C_CSPlayer::Simulate( void )
for (int i = 0; i < m_iBulletServerPositionCount; i++) for (int i = 0; i < m_iBulletServerPositionCount; i++)
{ {
debugoverlay->AddSweptBoxOverlay(m_vecServerShootPosition, debugoverlay->AddSweptBoxOverlay(m_vecServerShootPosition[i],
m_vecBulletServerPositions[i], m_vecBulletServerPositions[i],
Vector(-m_lastBulletDiameter, Vector(-m_lastBulletDiameter,
-m_lastBulletDiameter, -m_lastBulletDiameter,

View file

@ -7973,8 +7973,8 @@ void CMovementSpeedMod::InputSpeedMod(inputdata_t &data)
SendPropFloat ( SENDINFO( m_flLaggedMovementValue ), 0, SPROP_NOSCALE ), SendPropFloat ( SENDINFO( m_flLaggedMovementValue ), 0, SPROP_NOSCALE ),
SendPropArray3( SENDINFO_ARRAY3(m_vecBulletServerPositions), SendPropVector(SENDINFO_ARRAY(m_vecBulletServerPositions))), SendPropArray3( SENDINFO_ARRAY3(m_vecBulletServerPositions), SendPropVector(SENDINFO_ARRAY(m_vecBulletServerPositions))),
SendPropInt(SENDINFO(m_iBulletServerPositionCount)), SendPropInt(SENDINFO(m_iBulletServerPositionCount)),
SendPropVector(SENDINFO(m_vecServerShootPosition)) SendPropArray3( SENDINFO_ARRAY3(m_vecServerShootPosition), SendPropVector(SENDINFO_ARRAY(m_vecServerShootPosition))),
END_SEND_TABLE() END_SEND_TABLE()
// -------------------------------------------------------------------------------- // // -------------------------------------------------------------------------------- //

View file

@ -1212,7 +1212,7 @@ public:
virtual unsigned int PlayerSolidMask( bool brushOnly = false ) const; // returns the solid mask for the given player, so bots can have a more-restrictive set virtual unsigned int PlayerSolidMask( bool brushOnly = false ) const; // returns the solid mask for the given player, so bots can have a more-restrictive set
CNetworkArray(Vector, m_vecBulletServerPositions, MAX_PLAYER_BULLET_SERVER_POSITIONS); CNetworkArray(Vector, m_vecBulletServerPositions, MAX_PLAYER_BULLET_SERVER_POSITIONS);
CNetworkVar(int, m_iBulletServerPositionCount); CNetworkVar(int, m_iBulletServerPositionCount);
CNetworkVar(Vector, m_vecServerShootPosition); CNetworkArray(Vector, m_vecServerShootPosition, MAX_PLAYER_BULLET_SERVER_POSITIONS);
}; };
typedef CHandle<CBasePlayer> CBasePlayerHandle; typedef CHandle<CBasePlayer> CBasePlayerHandle;

View file

@ -478,29 +478,6 @@ void CCSPlayer::FireBullet(
VectorNormalize( vecDir ); VectorNormalize( vecDir );
//Adrian: visualize server/client player positions
//This is used to show where the lag compesator thinks the player should be at.
#if 0
for ( int k = 1; k <= gpGlobals->maxClients; k++ )
{
CBasePlayer *clientClass = (CBasePlayer *)CBaseEntity::Instance( k );
if ( clientClass == NULL )
continue;
if ( k == entindex() )
continue;
#ifdef CLIENT_DLL
debugoverlay->AddBoxOverlay( clientClass->GetAbsOrigin(), clientClass->WorldAlignMins(), clientClass->WorldAlignMaxs(), QAngle( 0, 0, 0), 255,0,0,127, 4 );
#else
NDebugOverlay::Box( clientClass->GetAbsOrigin(), clientClass->WorldAlignMins(), clientClass->WorldAlignMaxs(), 0,0,255,127, 4 );
#endif
}
#endif
//============================================================================= //=============================================================================
// HPE_BEGIN: // HPE_BEGIN:
@ -610,6 +587,7 @@ void CCSPlayer::FireBullet(
if (m_iBulletServerPositionCount.Get() < MAX_PLAYER_BULLET_SERVER_POSITIONS) if (m_iBulletServerPositionCount.Get() < MAX_PLAYER_BULLET_SERVER_POSITIONS)
{ {
m_vecBulletServerPositions.Set(m_iBulletServerPositionCount.Get(), tr.endpos); m_vecBulletServerPositions.Set(m_iBulletServerPositionCount.Get(), tr.endpos);
m_vecServerShootPosition.Set(m_iBulletServerPositionCount.Get(), vecSrc);
m_iBulletServerPositionCount.Set(m_iBulletServerPositionCount.Get() + 1); m_iBulletServerPositionCount.Set(m_iBulletServerPositionCount.Get() + 1);
} }
#endif #endif

View file

@ -294,7 +294,6 @@ void FX_FireBullets(
#ifndef CLIENT_DLL #ifndef CLIENT_DLL
pPlayer->m_iBulletServerPositionCount.Set(0); pPlayer->m_iBulletServerPositionCount.Set(0);
pPlayer->m_vecServerShootPosition.Set(vOrigin);
#endif #endif
for ( int iBullet=0; iBullet < pWeaponInfo->m_iBullets; iBullet++ ) for ( int iBullet=0; iBullet < pWeaponInfo->m_iBullets; iBullet++ )
{ {