In previous source games, weapon brass ejection could be disabled by using the cl_ejectbrass command, as seen in c_te_legacytempents.ccp:
void CTempEnts::EjectBrass( const Vector &pos1, const QAngle &angles, const QAngle &gunAngles, int type )
{
if ( cl_ejectbrass.GetBool() == false )
return;
...
}
This can't be done in tf2, as the function in charge of brass ejection doesn't check for it, making cl_ejectbrass completely useless. This can be fixed by opening tf_weaponbase.cpp , searching for the function called CTFWeaponBase::OnFireEvent and making the ejectbrass section check for cl_ejectbrass:
extern ConVar cl_ejectbrass;
bool CTFWeaponBase::OnFireEvent( C_BaseViewModel *pViewModel, const Vector& origin, const QAngle& angles, int event, const char *options )
{
if ( event == 6002 && ShouldEjectBrass() )
{
if ( cl_ejectbrass.GetBool() == false )
return;
if ( UsingViewModel() && !g_pClientMode->ShouldDrawViewModel() )
{
// Prevent effects when the ViewModel is hidden with r_drawviewmodel=0
return true;
}
...
}
In previous source games, weapon brass ejection could be disabled by using the
cl_ejectbrass
command, as seen inc_te_legacytempents.ccp
:This can't be done in tf2, as the function in charge of brass ejection doesn't check for it, making cl_ejectbrass completely useless. This can be fixed by opening
tf_weaponbase.cpp
, searching for the function calledCTFWeaponBase::OnFireEvent
and making the ejectbrass section check for cl_ejectbrass: