Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/game/shared/tf/tf_weapon_jar_gas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "func_respawnroom.h"
#endif

ConVar tf_debug_gas("tf_debug_gas", "0", FCVAR_CHEAT | FCVAR_REPLICATED, "Visualize the gas particles.");

IMPLEMENT_NETWORKCLASS_ALIASED( TFJarGas, DT_TFWeaponJarGas )

Expand Down Expand Up @@ -398,6 +399,12 @@ void CTFGasManager::OnCollide( CBaseEntity *pEnt, int iPointIndex )
}
#endif // GAME_DLL

void DebugGas( const Vector& vStart, const Vector& vEnd, const Vector& vMin, const Vector& vMax, const Color& color )
{
NDebugOverlay::Line( vStart, vEnd, 255, 255, 0, false, 0.0f );
NDebugOverlay::SweptBox( vStart, vEnd, vMin, vMax, vec3_angle, color.r(), color.g(), color.b(), color.a(), 0.0f );
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -606,6 +613,23 @@ void CTFGasManager::Update()
}
}
#endif // CLIENT_DLL

if ( tf_debug_gas.GetBool() )
{
#ifdef GAME_DLL
Color color(0, 0, 255, 100);
#else
Color color(255, 0, 0, 100);
#endif
FOR_EACH_VEC( GetPointVec(), i )
{
float flRadius = GetRadius( GetPointVec()[i] );
Vector vMins = flRadius * Vector(-1, -1, -1);
Vector vMaxs = flRadius * Vector(1, 1, 1);

DebugGas( GetPointVec()[i]->m_vecPrevPosition, GetPointVec()[i]->m_vecPosition, vMins, vMaxs, color );
}
}
}

//-----------------------------------------------------------------------------
Expand Down