From e5712245702e00043562eb5d922c803bc91017f6 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sat, 24 Feb 2024 03:22:52 +0500 Subject: [PATCH] Remove completely useless language check. --- dlls/combat.cpp | 42 ++++++++++-------------------------------- dlls/effects.cpp | 9 +-------- dlls/globals.cpp | 2 +- dlls/player.cpp | 10 ++++------ dlls/util.cpp | 6 ------ dlls/util.h | 12 ------------ dlls/world.cpp | 12 ++---------- 7 files changed, 18 insertions(+), 75 deletions(-) diff --git a/dlls/combat.cpp b/dlls/combat.cpp index 512c8996..b0912c31 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -58,12 +58,6 @@ void CGib::SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs ) { int i; - if( g_Language == LANGUAGE_GERMAN ) - { - // no sticky gibs in germany right now! - return; - } - for( i = 0; i < cGibs; i++ ) { CGib *pGib = GetClassPtr( (CGib *)NULL ); @@ -126,16 +120,8 @@ void CGib::SpawnHeadGib( entvars_t *pevVictim ) { CGib *pGib = GetClassPtr( (CGib *)NULL ); - if( g_Language == LANGUAGE_GERMAN ) - { - pGib->Spawn( "models/germangibs.mdl" );// throw one head - pGib->pev->body = 0; - } - else - { - pGib->Spawn( "models/hgibs.mdl" );// throw one head - pGib->pev->body = 0; - } + pGib->Spawn( "models/hgibs.mdl" );// throw one head + pGib->pev->body = 0; if( pevVictim ) { @@ -187,25 +173,17 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human ) { CGib *pGib = GetClassPtr( (CGib *)NULL ); - if( g_Language == LANGUAGE_GERMAN ) + if( human ) { - pGib->Spawn( "models/germangibs.mdl" ); - pGib->pev->body = RANDOM_LONG( 0, GERMAN_GIB_COUNT - 1 ); + // human pieces + pGib->Spawn( "models/hgibs.mdl" ); + pGib->pev->body = RANDOM_LONG( 1, HUMAN_GIB_COUNT - 1 );// start at one to avoid throwing random amounts of skulls (0th gib) } else { - if( human ) - { - // human pieces - pGib->Spawn( "models/hgibs.mdl" ); - pGib->pev->body = RANDOM_LONG( 1, HUMAN_GIB_COUNT - 1 );// start at one to avoid throwing random amounts of skulls (0th gib) - } - else - { - // aliens - pGib->Spawn( "models/agibs.mdl" ); - pGib->pev->body = RANDOM_LONG( 0, ALIEN_GIB_COUNT - 1 ); - } + // aliens + pGib->Spawn( "models/agibs.mdl" ); + pGib->pev->body = RANDOM_LONG( 0, ALIEN_GIB_COUNT - 1 ); } if( pevVictim ) @@ -719,7 +697,7 @@ void CGib::BounceGibTouch( CBaseEntity *pOther ) } else { - if( g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED ) + if( m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED ) { vecSpot = pev->origin + Vector( 0.0f, 0.0f, 8.0f );//move up a bit, and trace down. UTIL_TraceLine( vecSpot, vecSpot + Vector( 0.0f, 0.0f, -24.0f ), ignore_monsters, ENT( pev ), &tr ); diff --git a/dlls/effects.cpp b/dlls/effects.cpp index 3cdd111d..f9afd987 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -1330,14 +1330,7 @@ LINK_ENTITY_TO_CLASS( gibshooter, CGibShooter ) void CGibShooter::Precache( void ) { - if( g_Language == LANGUAGE_GERMAN ) - { - m_iGibModelIndex = PRECACHE_MODEL( "models/germanygibs.mdl" ); - } - else - { - m_iGibModelIndex = PRECACHE_MODEL( "models/hgibs.mdl" ); - } + m_iGibModelIndex = PRECACHE_MODEL( "models/hgibs.mdl" ); } void CGibShooter::KeyValue( KeyValueData *pkvd ) diff --git a/dlls/globals.cpp b/dlls/globals.cpp index 28280887..f9a424c5 100644 --- a/dlls/globals.cpp +++ b/dlls/globals.cpp @@ -36,4 +36,4 @@ DLL_GLOBAL int g_iSkillLevel; DLL_GLOBAL int gDisplayTitle; DLL_GLOBAL BOOL g_fGameOver; DLL_GLOBAL const Vector g_vecZero = Vector( 0, 0, 0 ); -DLL_GLOBAL int g_Language; + diff --git a/dlls/player.cpp b/dlls/player.cpp index eebbc908..27f9705e 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3339,13 +3339,11 @@ void CBloodSplat::Spray( void ) { TraceResult tr; - if( g_Language != LANGUAGE_GERMAN ) - { - UTIL_MakeVectors( pev->angles ); - UTIL_TraceLine( pev->origin, pev->origin + gpGlobals->v_forward * 128, ignore_monsters, pev->owner, & tr ); + UTIL_MakeVectors( pev->angles ); + UTIL_TraceLine( pev->origin, pev->origin + gpGlobals->v_forward * 128, ignore_monsters, pev->owner, & tr ); + + UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); - UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); - } SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time + 0.1f; } diff --git a/dlls/util.cpp b/dlls/util.cpp index 56819f44..ac6e28f8 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -1100,9 +1100,6 @@ void UTIL_BloodStream( const Vector &origin, const Vector &direction, int color, if( !UTIL_ShouldShowBlood( color ) ) return; - if( g_Language == LANGUAGE_GERMAN && color == BLOOD_COLOR_RED ) - color = 0; - MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, origin ); WRITE_BYTE( TE_BLOODSTREAM ); WRITE_COORD( origin.x ); @@ -1124,9 +1121,6 @@ void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color, if( color == DONT_BLEED || amount == 0 ) return; - if( g_Language == LANGUAGE_GERMAN && color == BLOOD_COLOR_RED ) - color = 0; - if( g_pGameRules->IsMultiplayer() ) { // scale up blood effect in multiplayer for better visibility diff --git a/dlls/util.h b/dlls/util.h index 6ad28546..1fe4d418 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -401,18 +401,6 @@ void DBG_AssertFunction(BOOL fExpr, const char* szExpr, const char* szFile, int extern DLL_GLOBAL const Vector g_vecZero; -// -// Constants that were used only by QC (maybe not used at all now) -// -// Un-comment only as needed -// -#define LANGUAGE_ENGLISH 0 -#define LANGUAGE_GERMAN 1 -#define LANGUAGE_FRENCH 2 -#define LANGUAGE_BRITISH 3 - -extern DLL_GLOBAL int g_Language; - #define AMBIENT_SOUND_STATIC 0 // medium radius attenuation #define AMBIENT_SOUND_EVERYWHERE 1 #define AMBIENT_SOUND_SMALLRADIUS 2 diff --git a/dlls/world.cpp b/dlls/world.cpp index d96c10aa..02b1dfbf 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -513,16 +513,8 @@ void CWorld::Precache( void ) PRECACHE_SOUND( "common/bodydrop3.wav" );// dead bodies hitting the ground (animation events) PRECACHE_SOUND( "common/bodydrop4.wav" ); - g_Language = (int)CVAR_GET_FLOAT( "sv_language" ); - if( g_Language == LANGUAGE_GERMAN ) - { - PRECACHE_MODEL( "models/germangibs.mdl" ); - } - else - { - PRECACHE_MODEL( "models/hgibs.mdl" ); - PRECACHE_MODEL( "models/agibs.mdl" ); - } + PRECACHE_MODEL( "models/hgibs.mdl" ); + PRECACHE_MODEL( "models/agibs.mdl" ); PRECACHE_SOUND( "weapons/ric1.wav" ); PRECACHE_SOUND( "weapons/ric2.wav" );