From 61bed38ab68bffe109156e391230da460c34b920 Mon Sep 17 00:00:00 2001 From: Goennigoegoe Date: Thu, 28 May 2026 22:46:01 +0200 Subject: [PATCH 1/3] Base fix and messing with extreme fix. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 47340f78b03..2d94f378c3d 100644 --- a/.gitignore +++ b/.gitignore @@ -501,4 +501,5 @@ FodyWeavers.xsd *.msp # JetBrains Rider -*.sln.iml \ No newline at end of file +*.sln.iml +/game From e2483844a5c96538f923681c4fa02b30b9830825 Mon Sep 17 00:00:00 2001 From: Goennigoegoe Date: Thu, 28 May 2026 22:58:14 +0200 Subject: [PATCH 2/3] Base and extreme fix with CVars for settings like base fix and more extreme fix. --- src/createtfprojects.bat | 1 + src/game/shared/tf/tf_gamerules.cpp | 6 ++++-- src/game/shared/tf/tf_gamerules.h | 2 ++ src/game/shared/tf/tf_weaponbase_rocket.cpp | 10 +++++++++- src/game/shared/tf/tf_weaponbase_rocket.h | 3 +++ 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/createtfprojects.bat diff --git a/src/createtfprojects.bat b/src/createtfprojects.bat new file mode 100644 index 00000000000..4badbc9f5a6 --- /dev/null +++ b/src/createtfprojects.bat @@ -0,0 +1 @@ +devtools\bin\vpc.exe /tf /define:SOURCESDK +game /mksln games_tf.sln \ No newline at end of file diff --git a/src/game/shared/tf/tf_gamerules.cpp b/src/game/shared/tf/tf_gamerules.cpp index 01640475c4a..974c53c47fa 100644 --- a/src/game/shared/tf/tf_gamerules.cpp +++ b/src/game/shared/tf/tf_gamerules.cpp @@ -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, }; @@ -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; diff --git a/src/game/shared/tf/tf_gamerules.h b/src/game/shared/tf/tf_gamerules.h index 56bd58bab57..60d3aa9993c 100644 --- a/src/game/shared/tf/tf_gamerules.h +++ b/src/game/shared/tf/tf_gamerules.h @@ -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; diff --git a/src/game/shared/tf/tf_weaponbase_rocket.cpp b/src/game/shared/tf/tf_weaponbase_rocket.cpp index 59ca309da85..7a88c79b90b 100644 --- a/src/game/shared/tf/tf_weaponbase_rocket.cpp +++ b/src/game/shared/tf/tf_weaponbase_rocket.cpp @@ -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. @@ -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. diff --git a/src/game/shared/tf/tf_weaponbase_rocket.h b/src/game/shared/tf/tf_weaponbase_rocket.h index 9fcf4ef1962..8de31ac7ccf 100644 --- a/src/game/shared/tf/tf_weaponbase_rocket.h +++ b/src/game/shared/tf/tf_weaponbase_rocket.h @@ -12,6 +12,7 @@ #include "cbase.h" #include "tf_shareddefs.h" #include "baseprojectile.h" +#include "convar.h" // Server specific. #ifdef GAME_DLL @@ -28,6 +29,8 @@ #define TF_FLARE_RADIUS_FOR_FJS (100.0f) #define TF_ROCKET_DESTROYABLE_TIMER (0.25) +extern ConVar tf_fix_splash; + //============================================================================= // From 8ef0e02af4fddce3a89d3dd0361de00c7e5d4beb Mon Sep 17 00:00:00 2001 From: Goennigoegoe Date: Sat, 30 May 2026 11:21:42 +0200 Subject: [PATCH 3/3] tried to remove some unnecessary changes --- .gitignore | 3 +-- src/createtfprojects.bat | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 src/createtfprojects.bat diff --git a/.gitignore b/.gitignore index 2d94f378c3d..47340f78b03 100644 --- a/.gitignore +++ b/.gitignore @@ -501,5 +501,4 @@ FodyWeavers.xsd *.msp # JetBrains Rider -*.sln.iml -/game +*.sln.iml \ No newline at end of file diff --git a/src/createtfprojects.bat b/src/createtfprojects.bat deleted file mode 100644 index 4badbc9f5a6..00000000000 --- a/src/createtfprojects.bat +++ /dev/null @@ -1 +0,0 @@ -devtools\bin\vpc.exe /tf /define:SOURCESDK +game /mksln games_tf.sln \ No newline at end of file