Corrected again a bit more cl_showimpacts

This commit is contained in:
Kamay Xutax 2024-07-19 05:09:43 +02:00
parent 860bd3e883
commit 96e8394525
17 changed files with 186 additions and 128 deletions

View file

@ -3189,7 +3189,7 @@ void _Host_RunFrame (float time)
g_ClientGlobalVariables.interpolation_amount = flInterpAmount - flLastInterpolationAmountOnTick;
ErrorIfNot(g_ClientGlobalVariables.interpolation_amount >= 0.0f,
("Interpolation amount was bigger than 1 (%f)\n", g_ClientGlobalVariables.interpolation_amount));
("Interpolation amount was lower than 0 (%f)\n", g_ClientGlobalVariables.interpolation_amount));
#ifdef false
printf("current interp: %f, old amount: %f, time: %f, frametime: %f, last remainder not interpolated: %f\n",
g_ClientGlobalVariables.interpolation_amount,

View file

@ -22,6 +22,8 @@
#include "c_te_legacytempents.h"
#include "activitylist.h"
#include "animation.h"
#include "recvproxy.h"
#include "studio.h"
#include "tier0/vprof.h"
#include "clienteffectprecachesystem.h"
#include "IEffects.h"
@ -200,8 +202,7 @@ IMPLEMENT_CLIENTCLASS_DT(C_BaseAnimating, DT_BaseAnimating, CBaseAnimating)
RecvPropFloat( RECVINFO( m_fadeMaxDist ) ),
RecvPropFloat( RECVINFO( m_flFadeScale ) ),
RecvPropArray3( RECVINFO_ARRAY(m_vecHitboxServerPositions), RecvPropVector(RECVINFO(m_vecHitboxServerPositions[0]))),
RecvPropArray3( RECVINFO_ARRAY(m_angHitboxServerAngles), RecvPropQAngles(RECVINFO(m_angHitboxServerAngles[0]))),
RecvPropArray3( RECVINFO_ARRAY(m_angHitboxServerAngles), RecvPropQAngles(RECVINFO(m_angHitboxServerAngles[0])))
END_RECV_TABLE()
@ -4538,7 +4539,7 @@ void C_BaseAnimating::PreDataUpdate( DataUpdateType_t updateType )
for ( i=0;i<MAXSTUDIOPOSEPARAM;i++ )
{
m_flOldPoseParameters[i] = m_flPoseParameter[i];
}
}
BaseClass::PreDataUpdate( updateType );
}
@ -4583,7 +4584,8 @@ void C_BaseAnimating::PostDataUpdate( DataUpdateType_t updateType )
{
if ( m_flOldEncodedController[i] != m_flEncodedController[i] )
{
bBoneControllersChanged = true;
bBoneControllersChanged = true;
break;
}
}
@ -4593,11 +4595,12 @@ void C_BaseAnimating::PostDataUpdate( DataUpdateType_t updateType )
{
if ( m_flOldPoseParameters[i] != m_flPoseParameter[i] )
{
bPoseParametersChanged = true;
bPoseParametersChanged = true;
break;
}
}
}
// Cycle change? Then re-render
// Cycle change? Then re-render
bool bAnimationChanged = m_flOldCycle != GetCycle() || bBoneControllersChanged || bPoseParametersChanged;
bool bSequenceChanged = m_nOldSequence != GetSequence();
bool bScaleChanged = ( m_flOldModelScale != GetModelScale() );
@ -5013,12 +5016,6 @@ void C_BaseAnimating::Simulate()
{
ClearRagdoll();
}
if (cl_showhitboxes.GetBool() && IsPlayer() && (this != C_BasePlayer::GetLocalPlayer()))
{
DrawClientHitboxes(gpGlobals->frametime, true);
DrawServerHitboxes(gpGlobals->frametime, true);
}
}

View file

@ -640,6 +640,8 @@ private:
mutable CStudioHdr *m_pStudioHdr;
mutable MDLHandle_t m_hStudioHdr;
CThreadFastMutex m_StudioHdrInitLock;
public:
Vector m_vecHitboxServerPositions[MAXSTUDIOBONES];
QAngle m_angHitboxServerAngles[MAXSTUDIOBONES];
};

View file

@ -7,9 +7,13 @@
//===========================================================================//
#include "cbase.h"
#include "c_baseplayer.h"
#include "cdll_client_int.h"
#include "convar.h"
#include "dt_recv.h"
#include "flashlighteffect.h"
#include "recvproxy.h"
#include "shareddefs.h"
#include "util_shared.h"
#include "weapon_selection.h"
#include "history_resource.h"
#include "iinput.h"
@ -60,6 +64,8 @@
// NVNT haptics system interface
#include "haptics/ihaptics.h"
#include "debugoverlay_shared.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@ -247,9 +253,10 @@ END_RECV_TABLE()
RecvPropInt ( RECVINFO( m_nWaterLevel ) ),
RecvPropFloat ( RECVINFO( m_flLaggedMovementValue )),
RecvPropArray3 ( RECVINFO_ARRAY(m_vecBulletServerPositions), RecvPropVector( RECVINFO(m_vecBulletServerPositions[0])) ),
RecvPropInt(RECVINFO(m_iBulletServerPositionCount)),
RecvPropArray3 ( RECVINFO_ARRAY(m_vecServerShootPosition), RecvPropVector( RECVINFO(m_vecServerShootPosition[0])) ),
RecvPropUtlVector ( RECVINFO_UTLVECTOR(m_vecBulletServerPositions), MAX_PLAYER_BULLET_SERVER_POSITIONS,RecvPropVector(NULL, 0) ),
RecvPropUtlVector ( RECVINFO_UTLVECTOR(m_vecServerShootPositions) ,MAX_PLAYER_BULLET_SERVER_POSITIONS, RecvPropVector(NULL, 0) ),
RecvPropBool (RECVINFO(m_bDebugServerBullets)),
RecvPropUtlVector ( RECVINFO_UTLVECTOR(m_touchedEntitiesWithBullet) ,MAX_PLAYER_BULLET_SERVER_POSITIONS, RecvPropVector(NULL, 0) ),
END_RECV_TABLE()
@ -445,8 +452,8 @@ C_BasePlayer::C_BasePlayer() : m_iv_vecViewOffset( "C_BasePlayer::m_iv_vecViewOf
ListenForGameEvent( "base_player_teleported" );
m_nTickBaseFireBullet = -1;
m_iBulletServerPositionCount = 0;
m_lastBulletDiameter = 1.0f;
m_bDebugServerBullets = false;
}
//-----------------------------------------------------------------------------
@ -488,7 +495,7 @@ void C_BasePlayer::Spawn( void )
m_bWasFreezeFraming = false;
m_bFiredWeapon = false;
m_bFiredWeapon = false;
}
//-----------------------------------------------------------------------------
@ -913,7 +920,7 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
if ( engine->IsPaused() || bForceEFNoInterp )
{
ResetLatched();
}
}
}
//-----------------------------------------------------------------------------
@ -2135,15 +2142,70 @@ void C_BasePlayer::Simulate()
ResetLatched();
}
static ConVarRef cl_showfirebullethitboxes("cl_showfirebullethitboxes");
static ConVarRef cl_showimpacts("cl_showimpacts");
static ConVarRef cl_showfirebullethitboxes("cl_showfirebullethitboxes");
bool shouldShowFireBulletHitbox = m_nTickBaseFireBullet <= m_nTickBase && m_nTickBaseFireBullet != -1;
if (shouldShowFireBulletHitbox && (cl_showimpacts.GetInt() == 1 || cl_showimpacts.GetInt() == 3 || cl_showfirebullethitboxes.GetBool()))
static ConVarRef cl_showhitboxes("cl_showhitboxes");
if (m_bDebugServerBullets)
{
DrawServerHitboxes(60.0f, true);
m_nTickBaseFireBullet = -1;
if (cl_showimpacts.GetInt() == 1 || cl_showimpacts.GetInt() == 3)
{
for (int i = 0; i < m_vecServerShootPositions.Count(); i++)
{
NDebugOverlay::SweptBox(m_vecServerShootPositions[i],
m_vecBulletServerPositions[i],
Vector(-m_lastBulletDiameter, -m_lastBulletDiameter, -m_lastBulletDiameter) / 2,
Vector(m_lastBulletDiameter, m_lastBulletDiameter, m_lastBulletDiameter) / 2,
QAngle(0, 0, 0),
0,
0,
255,
127,
60.f);
NDebugOverlay::Box(m_vecBulletServerPositions[i],
Vector(-m_lastBulletDiameter, -m_lastBulletDiameter, -m_lastBulletDiameter) / 2,
Vector(m_lastBulletDiameter, m_lastBulletDiameter, m_lastBulletDiameter) / 2,
0,
0,
255,
127,
60.f);
}
}
if (cl_showfirebullethitboxes.GetBool())
{
for (int i = 1; i <= gpGlobals->maxClients; i++)
{
auto player = UTIL_PlayerByIndex(i);
if (player && player != GetLocalPlayer())
{
player->DrawServerHitboxes(60.0f, true);
}
}
}
else
{
for (auto&& entityIndex : m_touchedEntitiesWithBullet)
{
auto player = UTIL_PlayerByIndex(entityIndex);
if (player && player != GetLocalPlayer())
{
player->DrawServerHitboxes(60.0f, true);
}
}
}
m_bDebugServerBullets = false;
}
if (cl_showhitboxes.GetBool() && IsPlayer() && this != GetLocalPlayer())
{
DrawClientHitboxes(gpGlobals->frametime, true);
DrawServerHitboxes(gpGlobals->frametime, true);
}
}
//-----------------------------------------------------------------------------

View file

@ -13,6 +13,7 @@
#pragma once
#endif
#include "utlvector.h"
#include "c_playerlocaldata.h"
#include "c_basecombatcharacter.h"
#include "PlayerState.h"
@ -639,10 +640,11 @@ public:
void SetOldPlayerZ( float flOld ) { m_flOldPlayerZ = flOld; }
int m_nTickBaseFireBullet;
Vector m_vecBulletServerPositions[MAX_PLAYER_BULLET_SERVER_POSITIONS];
int m_iBulletServerPositionCount;
Vector m_vecServerShootPosition[MAX_PLAYER_BULLET_SERVER_POSITIONS];
float m_lastBulletDiameter;
bool m_bDebugServerBullets;
CUtlVector<Vector> m_vecBulletServerPositions;
CUtlVector<Vector> m_vecServerShootPositions;
CUtlVector<int> m_touchedEntitiesWithBullet;
};
EXTERN_RECV_TABLE(DT_BasePlayer);

View file

@ -1349,6 +1349,10 @@ void C_CSPlayer::ValidateModelIndex( void )
UpdateMinModels();
}
void C_CSPlayer::PreDataUpdate(DataUpdateType_t updateType)
{
BaseClass::PreDataUpdate( updateType );
}
void C_CSPlayer::PostDataUpdate( DataUpdateType_t updateType )
{
@ -2227,42 +2231,6 @@ void C_CSPlayer::Simulate( void )
}
BaseClass::Simulate();
static ConVarRef cl_showimpacts("cl_showimpacts");
if ((cl_showimpacts.GetInt() == 1 || cl_showimpacts.GetInt() == 3) && m_lastBulletDiameter != -1.0f)
{
auto weaponInfo = GetActiveWeapon();
if (!weaponInfo)
{
return;
}
for (int i = 0; i < m_iBulletServerPositionCount; i++)
{
NDebugOverlay::SweptBox(m_vecServerShootPosition[i],
m_vecBulletServerPositions[i],
Vector(-m_lastBulletDiameter, -m_lastBulletDiameter, -m_lastBulletDiameter) / 2,
Vector(m_lastBulletDiameter, m_lastBulletDiameter, m_lastBulletDiameter) / 2,
QAngle(0, 0, 0),
0,
0,
255,
127,
60.f);
NDebugOverlay::Box(m_vecBulletServerPositions[i],
Vector(-m_lastBulletDiameter, -m_lastBulletDiameter, -m_lastBulletDiameter) / 2,
Vector(m_lastBulletDiameter, m_lastBulletDiameter, m_lastBulletDiameter) / 2,
0,
0,
255,
127,
60.f);
}
m_lastBulletDiameter = -1.0f;
}
}
void C_CSPlayer::PostThink()

View file

@ -91,6 +91,7 @@ public:
virtual void ClientThink();
virtual void OnDataChanged( DataUpdateType_t type );
virtual void PreDataUpdate( DataUpdateType_t updateType );
virtual void PostDataUpdate( DataUpdateType_t updateType );
virtual bool Interpolate( float currentTime );
virtual void UpdateStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity );
@ -168,7 +169,6 @@ public:
public:
virtual float GetPlayerMaxSpeed();
float m_lastBulletDiameter;
float GetBulletDiameter(int iBulletType);
void GetBulletTypeParameters(
int iBulletType,

View file

@ -1316,22 +1316,22 @@ void CInput::CreateMove ( int sequence_number, float input_sample_frametime, boo
static ConVarRef cl_showhitboxes("cl_showhitboxes");
cmd->debug_hitboxes = CUserCmd::DEBUG_HITBOXES_OFF;
if (cl_showhitboxes.GetBool())
{
cmd->debug_hitboxes = CUserCmd::DEBUG_HITBOXES_ALWAYS_ON;
cmd->debug_hitboxes |= CUserCmd::DEBUG_HITBOXES_ALWAYS_ON;
}
else if (cl_showfirebullethitboxes.GetBool())
if (cl_showfirebullethitboxes.GetBool())
{
cmd->debug_hitboxes = CUserCmd::DEBUG_HITBOXES_ON_BULLET;
cmd->debug_hitboxes |= CUserCmd::DEBUG_HITBOXES_ON_FIRE;
}
else if (cl_showimpacts.GetInt() == 1 || cl_showimpacts.GetInt() == 3)
if (cl_showimpacts.GetInt() == 1 || cl_showimpacts.GetInt() == 3)
{
cmd->debug_hitboxes = CUserCmd::DEBUG_HITBOXES_ON_HIT;
cmd->debug_hitboxes |= CUserCmd::DEBUG_HITBOXES_ON_HIT;
}
else
{
cmd->debug_hitboxes = CUserCmd::DEBUG_HITBOXES_OFF;
}
pVerified->m_cmd = *cmd;

View file

@ -203,6 +203,32 @@ void* SendTableProxy_HitboxServerAngles(const SendProp* pProp,
return ((QAngle*)pData + entity->entindex() * MAXSTUDIOBONES);
}
void SendProxy_ShouldShowServerHitboxesOnFire(const SendProp* pProp,
const void* pStructBase,
const void* pData,
DVariant* pOut,
int iElement,
int objectID)
{
auto index = engine->GetSendTableCurrentEntityIndex();
if (index == -1)
{
pOut->m_Int = false;
return;
}
CBaseEntity* entity = UTIL_EntityByIndex(index);
if (!entity)
{
pOut->m_Int = false;
return;
}
pOut->m_Int = *((bool*)pData + entity->entindex());
}
static CIKSaveRestoreOps s_IKSaveRestoreOp;
@ -311,7 +337,6 @@ IMPLEMENT_SERVERCLASS_ST(CBaseAnimating, DT_BaseAnimating)
SendPropFloat( SENDINFO( m_flFadeScale ), 0, SPROP_NOSCALE ),
SendPropArray3 (SENDINFO_NAME(m_vecHitboxServerPositions[0][0], m_vecHitboxServerPositions), MAXSTUDIOBONES, SendPropVector(SENDINFO_NAME(m_vecHitboxServerPositions[0][0], m_vecHitboxServerPositions[0]) ), SendTableProxy_HitboxServerPositions),
SendPropArray3 (SENDINFO_NAME(m_angHitboxServerAngles[0][0], m_angHitboxServerAngles), MAXSTUDIOBONES, SendPropQAngles(SENDINFO_NAME(m_angHitboxServerAngles[0][0], m_angHitboxServerAngles[0]) ), SendTableProxy_HitboxServerAngles),
END_SEND_TABLE()
@ -346,7 +371,7 @@ CBaseAnimating::CBaseAnimating()
{
m_vecHitboxServerPositions[i][j] = vec3_origin;
m_angHitboxServerAngles[i][j] = vec3_angle;
}
}
}
}

View file

@ -6,6 +6,8 @@
#ifndef BASEANIMATING_H
#define BASEANIMATING_H
#include "networkvar.h"
#include "shareddefs.h"
#ifdef _WIN32
#pragma once
#endif

View file

@ -9,6 +9,8 @@
#include "baseplayer_shared.h"
#include "dt_common.h"
#include "dt_send.h"
#include "sendproxy.h"
#include "shareddefs.h"
#include "trains.h"
#include "soundent.h"
#include "gib.h"
@ -636,7 +638,6 @@ CBasePlayer::CBasePlayer( )
m_flLastUserCommandTime = 0.f;
m_flMovementTimeForUserCmdProcessingRemaining = 0.0f;
m_iBulletServerPositionCount.Set(0);
}
CBasePlayer::~CBasePlayer( )
@ -4521,6 +4522,7 @@ void CBasePlayer::ForceOrigin( const Vector &vecOrigin )
//-----------------------------------------------------------------------------
void CBasePlayer::PostThink()
{
m_bDebugServerBullets = false;
m_vecSmoothedVelocity = m_vecSmoothedVelocity * SMOOTHING_FACTOR + GetAbsVelocity() * ( 1 - SMOOTHING_FACTOR );
if ( !g_fGameOver && !m_iPlayerLocked )
@ -7972,9 +7974,10 @@ void CMovementSpeedMod::InputSpeedMod(inputdata_t &data)
SendPropInt ( SENDINFO( m_nWaterLevel ), 2, SPROP_UNSIGNED ),
SendPropFloat ( SENDINFO( m_flLaggedMovementValue ), 0, SPROP_NOSCALE ),
SendPropArray3( SENDINFO_ARRAY3(m_vecBulletServerPositions), SendPropVector(SENDINFO_ARRAY(m_vecBulletServerPositions))),
SendPropInt(SENDINFO(m_iBulletServerPositionCount)),
SendPropArray3( SENDINFO_ARRAY3(m_vecServerShootPosition), SendPropVector(SENDINFO_ARRAY(m_vecServerShootPosition))),
SendPropUtlVector( SENDINFO_UTLVECTOR(m_vecBulletServerPositions), MAX_PLAYER_BULLET_SERVER_POSITIONS, SendPropVector(NULL, 0)),
SendPropUtlVector( SENDINFO_UTLVECTOR(m_vecServerShootPositions), MAX_PLAYER_BULLET_SERVER_POSITIONS, SendPropVector(NULL, 0)),
SendPropBool(SENDINFO(m_bDebugServerBullets)),
SendPropUtlVector( SENDINFO_UTLVECTOR(m_touchedEntitiesWithBullet), MAX_PLAYER_BULLET_SERVER_POSITIONS, SendPropVector(NULL, 0)),
END_SEND_TABLE()

View file

@ -10,6 +10,7 @@
#pragma once
#endif
#include "utlvector.h"
#include "basecombatcharacter.h"
#include "usercmd.h"
#include "playerlocaldata.h"
@ -1210,9 +1211,10 @@ private:
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
CNetworkArray(Vector, m_vecBulletServerPositions, MAX_PLAYER_BULLET_SERVER_POSITIONS);
CNetworkVar(int, m_iBulletServerPositionCount);
CNetworkArray(Vector, m_vecServerShootPosition, MAX_PLAYER_BULLET_SERVER_POSITIONS);
CNetworkVar(bool, m_bDebugServerBullets);
CUtlVector<Vector> m_vecBulletServerPositions;
CUtlVector<Vector> m_vecServerShootPositions;
CUtlVector<int> m_touchedEntitiesWithBullet;
};
typedef CHandle<CBasePlayer> CBasePlayerHandle;

View file

@ -346,7 +346,7 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
g_pGameMovement->StartTrackPredictionErrors( player );
if (ucmd->debug_hitboxes == CUserCmd::DEBUG_HITBOXES_ALWAYS_ON)
if (ucmd->debug_hitboxes & CUserCmd::DEBUG_HITBOXES_ALWAYS_ON)
{
lagcompensation->StartLagCompensation( player, player->GetCurrentCommand() );

View file

@ -491,6 +491,7 @@ void CCSPlayer::FireBullet(
#ifdef CLIENT_DLL
static ConVarRef cl_showfirebullethitboxes("cl_showfirebullethitboxes");
if (cl_showfirebullethitboxes.GetBool())
{
for (int i = 1; i <= gpGlobals->maxClients; i++)
@ -500,12 +501,11 @@ void CCSPlayer::FireBullet(
if ( lagPlayer && !lagPlayer->IsLocalPlayer() && IsLocalPlayer())
{
lagPlayer->DrawClientHitboxes(60, true);
lagPlayer->m_nTickBaseFireBullet = int(lagPlayer->GetTimeBase() / TICK_INTERVAL);
}
}
}
#else
if ( m_pCurrentCommand->debug_hitboxes == CUserCmd::DEBUG_HITBOXES_ON_BULLET || m_pCurrentCommand->debug_hitboxes == CUserCmd::DEBUG_HITBOXES_ALWAYS_ON )
if ( m_pCurrentCommand->debug_hitboxes & CUserCmd::DEBUG_HITBOXES_ON_FIRE )
{
for (int i = 1; i <= gpGlobals->maxClients; i++)
{
@ -563,12 +563,11 @@ void CCSPlayer::FireBullet(
flDamageModifier = 0.99f;
}
#ifdef CLIENT_DLL
m_lastBulletDiameter = flBulletDiameter;
#endif
#ifdef CLIENT_DLL
static ConVarRef cl_showimpacts("cl_showimpacts");
m_lastBulletDiameter = flBulletDiameter;
static ConVarRef cl_showimpacts("cl_showimpacts");
if (cl_showimpacts.GetInt() == 1 || cl_showimpacts.GetInt() == 2)
{
@ -582,38 +581,30 @@ void CCSPlayer::FireBullet(
0,
127,
60.0f);
}
NDebugOverlay::Box(tr.endpos, vecBulletRadiusMins, vecBulletRadiusMaxs, 255, 0, 0, 127, 60.f);
}
if (tr.m_pEnt && tr.m_pEnt->IsPlayer())
{
C_BasePlayer* player = ToBasePlayer(tr.m_pEnt);
if (tr.m_pEnt && tr.m_pEnt->IsPlayer())
{
C_BasePlayer* player = ToBasePlayer(tr.m_pEnt);
if (cl_showimpacts.GetInt() == 1
|| cl_showimpacts.GetInt() == 2)
if (cl_showimpacts.GetInt() == 1 || cl_showimpacts.GetInt() == 2)
{
NDebugOverlay::Box(tr.endpos,
vecBulletRadiusMins,
vecBulletRadiusMaxs,
255,
0,
0,
127,
60.f);
player->DrawClientHitboxes(60.0f, true);
}
player->m_nTickBaseFireBullet = int(player->GetTimeBase()
/ TICK_INTERVAL);
}
}
#else
if ( m_pCurrentCommand->debug_hitboxes == CUserCmd::DEBUG_HITBOXES_ON_HIT || m_pCurrentCommand->debug_hitboxes == CUserCmd::DEBUG_HITBOXES_ALWAYS_ON )
{
if (m_iBulletServerPositionCount.Get() < MAX_PLAYER_BULLET_SERVER_POSITIONS)
bool shouldShowServerHitRegistration = m_pCurrentCommand->debug_hitboxes & CUserCmd::DEBUG_HITBOXES_ON_HIT;
if (shouldShowServerHitRegistration)
{
m_vecBulletServerPositions.AddToTail(tr.endpos);
m_vecServerShootPositions.AddToTail(vecSrc);
if (tr.m_pEnt)
{
m_vecBulletServerPositions.Set(m_iBulletServerPositionCount.Get(), tr.endpos);
m_vecServerShootPosition.Set(m_iBulletServerPositionCount.Get(), vecSrc);
m_iBulletServerPositionCount.Set(m_iBulletServerPositionCount.Get() + 1);
}
m_touchedEntitiesWithBullet.AddToTail(tr.m_pEnt->entindex());
}
if (tr.m_pEnt && tr.m_pEnt->IsPlayer())
{
@ -623,7 +614,7 @@ void CCSPlayer::FireBullet(
}
#endif
//calculate the damage based on the distance the bullet travelled.
//calculate the damage based on the distance the bullet travelled.
flCurrentDistance += tr.fraction * flDistance;
fCurrentDamage *= pow (flRangeModifier, (flCurrentDistance / 500));

View file

@ -10,7 +10,7 @@
#include "weapon_csbase.h"
#ifndef CLIENT_DLL
#include "ilagcompensationmanager.h"
#include "ilagcompensationmanager.h"
#endif
ConVar weapon_accuracy_logging( "weapon_accuracy_logging", "0", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY | FCVAR_ARCHIVE );
@ -292,8 +292,12 @@ void FX_FireBullets(
}
#ifndef CLIENT_DLL
pPlayer->m_iBulletServerPositionCount.Set(0);
pPlayer->m_vecBulletServerPositions.RemoveAll();
pPlayer->m_vecServerShootPositions.RemoveAll();
pPlayer->m_touchedEntitiesWithBullet.RemoveAll();
pPlayer->m_bDebugServerBullets = true;
#endif
for ( int iBullet=0; iBullet < pWeaponInfo->m_iBullets; iBullet++ )
{
#ifdef CLIENT_DLL
@ -314,7 +318,7 @@ void FX_FireBullets(
pPlayer,
bDoEffects,
x0 + x1[iBullet], y0 + y1[iBullet] );
}
}
#if !defined (CLIENT_DLL)
lagcompensation->FinishLagCompensation( pPlayer );

View file

@ -219,7 +219,7 @@ void WriteUsercmd( bf_write *buf, const CUserCmd *to, const CUserCmd *from )
if (to->debug_hitboxes != from->debug_hitboxes)
{
buf->WriteOneBit(1);
buf->WriteUBitLong(to->debug_hitboxes, 2);
buf->WriteUBitLong(to->debug_hitboxes, 3);
}
else
{
@ -362,7 +362,7 @@ void ReadUsercmd( bf_read *buf, CUserCmd *move, CUserCmd *from )
if ( buf->ReadOneBit() )
{
move->debug_hitboxes = (CUserCmd::debug_hitboxes_t)buf->ReadUBitLong(2);
move->debug_hitboxes = (CUserCmd::debug_hitboxes_t)buf->ReadUBitLong(3);
}
#if defined( HL2_DLL )

View file

@ -220,12 +220,12 @@ public:
enum debug_hitboxes_t : uint8
{
DEBUG_HITBOXES_OFF,
DEBUG_HITBOXES_ALWAYS_ON,
DEBUG_HITBOXES_ON_BULLET,
DEBUG_HITBOXES_ON_HIT
DEBUG_HITBOXES_ALWAYS_ON = 1 << 0,
DEBUG_HITBOXES_ON_FIRE = 1 << 1,
DEBUG_HITBOXES_ON_HIT = 1 << 2
};
debug_hitboxes_t debug_hitboxes;
uint8 debug_hitboxes;
// Back channel to communicate IK state
#if defined( HL2_DLL ) || defined( HL2_CLIENT_DLL )