From 216bbf1baade1c75748fd38abf5ea33063ed18d1 Mon Sep 17 00:00:00 2001 From: nillerusr Date: Wed, 31 Aug 2022 18:23:22 +0300 Subject: [PATCH] game(hl1): fix gibbing --- game/server/hl1/hl1_ai_basenpc.cpp | 2 +- game/server/hl1/hl1_ents.cpp | 2 +- game/server/hl1/hl1_npc_hgrunt.cpp | 4 ++-- game/server/hl1/hl1_npc_houndeye.cpp | 4 ++-- game/server/hl1/hl1_npc_talker.cpp | 10 ++++++---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/game/server/hl1/hl1_ai_basenpc.cpp b/game/server/hl1/hl1_ai_basenpc.cpp index f97faf09..aa4de38a 100644 --- a/game/server/hl1/hl1_ai_basenpc.cpp +++ b/game/server/hl1/hl1_ai_basenpc.cpp @@ -180,7 +180,7 @@ bool CHL1BaseNPC::CorpseGib( const CTakeDamageInfo &info ) CSoundEnt::InsertSound( SOUND_MEAT, GetAbsOrigin(), 256, 0.5f, this ); -/// BaseClass::CorpseGib( info ); + BaseClass::CorpseGib( info ); return true; } diff --git a/game/server/hl1/hl1_ents.cpp b/game/server/hl1/hl1_ents.cpp index 5aba5f29..4254815e 100644 --- a/game/server/hl1/hl1_ents.cpp +++ b/game/server/hl1/hl1_ents.cpp @@ -1587,7 +1587,7 @@ void CHL1Gib::Spawn( const char *szGibModel ) SetNextThink( gpGlobals->curtime + 4 ); - m_lifeTime = 25; + m_lifeTime = 250; SetThink ( &CHL1Gib::WaitTillLand ); SetTouch ( &CHL1Gib::BounceGibTouch ); diff --git a/game/server/hl1/hl1_npc_hgrunt.cpp b/game/server/hl1/hl1_npc_hgrunt.cpp index f2b7bf12..f443541a 100644 --- a/game/server/hl1/hl1_npc_hgrunt.cpp +++ b/game/server/hl1/hl1_npc_hgrunt.cpp @@ -487,10 +487,10 @@ int CNPC_HGrunt::SquadRecruit( int searchRadius, int maxMembers ) } else { - static char szSquadName[64]; + char szSquadName[64]; Q_snprintf( szSquadName, sizeof( szSquadName ), "squad%d\n", g_iSquadIndex ); - m_SquadName = MAKE_STRING( szSquadName ); + m_SquadName = AllocPooledString( szSquadName ); while ( ( pEntity = gEntList.FindEntityInSphere( pEntity, GetAbsOrigin(), searchRadius ) ) != NULL ) { diff --git a/game/server/hl1/hl1_npc_houndeye.cpp b/game/server/hl1/hl1_npc_houndeye.cpp index f9bbed2e..964e0936 100644 --- a/game/server/hl1/hl1_npc_houndeye.cpp +++ b/game/server/hl1/hl1_npc_houndeye.cpp @@ -994,10 +994,10 @@ int CNPC_Houndeye::SquadRecruit( int searchRadius, int maxMembers ) } else { - static char szSquadName[64]; + char szSquadName[64]; Q_snprintf( szSquadName, sizeof( szSquadName ), "squad%d\n", s_iSquadIndex ); - m_SquadName = MAKE_STRING( szSquadName ); + m_SquadName = AllocPooledString( szSquadName ); while ( ( pEntity = gEntList.FindEntityInSphere( pEntity, GetAbsOrigin(), searchRadius ) ) != NULL && squadCount < maxMembers ) { diff --git a/game/server/hl1/hl1_npc_talker.cpp b/game/server/hl1/hl1_npc_talker.cpp index 2797ceca..8629d5da 100644 --- a/game/server/hl1/hl1_npc_talker.cpp +++ b/game/server/hl1/hl1_npc_talker.cpp @@ -572,21 +572,23 @@ void CHL1NPCTalker::SetHeadDirection( const Vector &vTargetPos, float flInterval bool CHL1NPCTalker::CorpseGib( const CTakeDamageInfo &info ) { CEffectData data; - + data.m_vOrigin = WorldSpaceCenter(); data.m_vNormal = data.m_vOrigin - info.GetDamagePosition(); VectorNormalize( data.m_vNormal ); - + data.m_flScale = RemapVal( m_iHealth, 0, -500, 1, 3 ); data.m_flScale = clamp( data.m_flScale, 1, 3 ); - data.m_nMaterial = 1; + data.m_nMaterial = 1; data.m_nHitBox = -m_iHealth; data.m_nColor = BloodColor(); - + DispatchEffect( "HL1Gib", data ); + BaseClass::CorpseGib( info ); + CSoundEnt::InsertSound( SOUND_MEAT, GetAbsOrigin(), 256, 0.5f, this ); return true;