Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions src/game/shared/tf/tf_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ ConVar tf_mvm_respec_credit_goal( "tf_mvm_respec_credit_goal", "2000", FCVAR_CHE
ConVar tf_mvm_buybacks_method( "tf_mvm_buybacks_method", "0", FCVAR_REPLICATED | FCVAR_HIDDEN, "When set to 0, use the traditional, currency-based system. When set to 1, use finite, charge-based system.", true, 0.0, true, 1.0 );
ConVar tf_mvm_buybacks_per_wave( "tf_mvm_buybacks_per_wave", "3", FCVAR_REPLICATED | FCVAR_HIDDEN, "The fixed number of buybacks players can use per-wave." );

ConVar tf_splash_fix( "tf_splash_fix", "1", FCVAR_PROTECTED, "Fixes a bug where splash damage could go through walls. Rockets may still visually disapear and may not deal any damage in rare cases." );

#ifdef GAME_DLL
enum { kMVM_CurrencyPackMinSize = 1, };
Expand Down Expand Up @@ -5780,8 +5781,9 @@ int CTFRadiusDamageInfo::ApplyToEntity( CBaseEntity *pEntity )
UTIL_TraceLine( vecSrc, vecSpot, MASK_RADIUS_DAMAGE, &filterSelf, &tr );
}

// If we don't trace the whole way to the target, and we didn't hit the target entity, we're blocked
if ( tr.fraction != 1.f && tr.m_pEnt != pEntity )
// If we don't trace the whole way to the target, and we didn't hit the target entity, we're blocked.
// Startsolid check since if a trace starts within a wall, often it will give fraction as 1.0
if ( ( tr.fraction != 1.f && tr.m_pEnt != pEntity ) || ( tf_splash_fix.GetBool( ) && tr.startsolid && tr.m_pEnt != pEntity ) )
{
// Don't let projectiles block damage
return 0;
Expand Down
2 changes: 2 additions & 0 deletions src/game/shared/tf/tf_gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class CMannVsMachineUpgrades;
extern ConVar tf_mvm_defenders_team_size;
extern ConVar tf_mvm_max_invaders;

extern ConVar tf_splash_fix;

const int kLadder_TeamSize_6v6 = 6;
const int kLadder_TeamSize_9v9 = 9;
const int kLadder_TeamSize_12v12 = 12;
Expand Down
10 changes: 9 additions & 1 deletion src/game/shared/tf/tf_weaponbase_rocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ END_DATADESC()
ConVar tf_rocket_show_radius( "tf_rocket_show_radius", "0", FCVAR_REPLICATED | FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY, "Render rocket radius." );
#endif

ConVar tf_splash_fix_extreme( "tf_splash_fix_extreme", "0", FCVAR_PROTECTED, "Don't use unless necessary. Plane normal will not be added to origin on explosion which might cause problems for small bumps or displacements." );

//=============================================================================
//
// Shared (client/server) functions.
Expand Down Expand Up @@ -433,7 +435,13 @@ void CTFBaseRocket::Explode( trace_t *pTrace, CBaseEntity *pOther )
// Pull out a bit.
if ( pTrace->fraction != 1.0 )
{
SetAbsOrigin( pTrace->endpos + ( pTrace->plane.normal * 1.0f ) );
if ( !tf_splash_fix_extreme.GetBool( ) )
{
// This line causes a bug where when the endpos + normal is within a wall, trace fraction will often be 1.0 or close enough to 1.0 to splash through things.
// Checking if the start is in a solid should fix it. This will still allow players to shoot around corners but without it, displacements and tiny bumps may block explosions.
// I don't know why this is done so I have added a ConVar so you can change it as a server-owner.
SetAbsOrigin( pTrace->endpos + ( pTrace->plane.normal * 1.0f ) );
}
}

// Play explosion sound and effect.
Expand Down
3 changes: 3 additions & 0 deletions src/game/shared/tf/tf_weaponbase_rocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "cbase.h"
#include "tf_shareddefs.h"
#include "baseprojectile.h"
#include "convar.h"

// Server specific.
#ifdef GAME_DLL
Expand All @@ -28,6 +29,8 @@
#define TF_FLARE_RADIUS_FOR_FJS (100.0f)
#define TF_ROCKET_DESTROYABLE_TIMER (0.25)

extern ConVar tf_fix_splash;


//=============================================================================
//
Expand Down