Skip to content

Commit 757a1cd

Browse files
committed
implement fr changes, add more npc patches
1 parent 1304889 commit 757a1cd

File tree

6 files changed

+51
-6
lines changed

6 files changed

+51
-6
lines changed

src/game/client/weapon_selection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ void CBaseHudWeaponSelection::UserCmd_Slot10(void)
401401
}
402402

403403
#ifdef BDSBASE
404+
#ifdef HL2_CLIENT_DLL
404405
void ClientInstantPhysSwap()
405406
{
406407
C_BasePlayer* pPlayer = C_BasePlayer::GetLocalPlayer();
@@ -433,6 +434,7 @@ void ClientInstantPhysSwap()
433434

434435
static ConCommand cl_physswap("phys_swap", ClientInstantPhysSwap, "Client-predicted physcannon swap for low-latency switching.");
435436
#endif
437+
#endif
436438

437439
//-----------------------------------------------------------------------------
438440
// Purpose: returns true if the CHudMenu should take slot1, etc commands

src/game/server/hl2/item_ammo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "eventlist.h"
1313
#include "npcevent.h"
1414
#ifdef BDSBASE
15-
#include "weapon_hl2mpbasebasebludgeon.h"
15+
#include "basebludgeonweapon.h"
1616
#endif
1717

1818
// memdbgon must be the last include file in a .cpp file!!!
@@ -938,7 +938,7 @@ int CItem_AmmoCrate::OnTakeDamage( const CTakeDamageInfo &info )
938938
CBaseCombatWeapon* weapon = player->GetActiveWeapon();
939939

940940
#ifdef BDSBASE
941-
if (weapon && dynamic_cast<CBaseHL2MPBludgeonWeapon*>(weapon))
941+
if (weapon && dynamic_cast<CBaseHLBludgeonWeapon*>(weapon))
942942
{
943943
if (info.GetDamageType() & DMG_CLUB)
944944
{

src/game/server/sound.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,12 @@ void CAmbientGeneric::SendSound( SoundFlags_t flags)
959959
UTIL_EmitAmbientSound( pSoundSource->GetSoundSourceIndex(), pSoundSource->GetAbsOrigin(), m_szSoundFile,
960960
(m_dpv.vol * 0.01), m_iSoundLevel, flags, m_dpv.pitch);
961961
#ifdef BDSBASE
962-
m_fActive = true;
962+
// Only mark active if this is a looping sound.
963+
// If not looping, each trigger will cause the sound to play.
964+
// If the sound is still playing from a previous trigger press,
965+
// it will be shut off and then restarted.
966+
if (m_fLooping)
967+
m_fActive = true;
963968
#endif
964969
}
965970
}

src/game/shared/SoundEmitterSystem.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,35 @@ class CSoundEmitterSystem : public CBaseGameSystem
314314
}
315315
#endif
316316

317+
#ifdef BDSBASE
318+
//load other files with the suffix _override or _custom
319+
FileFindHandle_t hFile = FILESYSTEM_INVALID_FIND_HANDLE;
320+
321+
for (const char* pszFoundFile = g_pFullFileSystem->FindFirst("scripts/*.txt", &hFile); pszFoundFile && hFile != FILESYSTEM_INVALID_FIND_HANDLE; pszFoundFile = g_pFullFileSystem->FindNext(hFile))
322+
{
323+
char szScriptName[2048];
324+
const char* suffix = "_sounds_override";
325+
326+
if (Q_strncmp(pszFoundFile, suffix, sizeof(suffix)) == 0)
327+
{
328+
Q_snprintf(szScriptName, sizeof(szScriptName), "scripts/%s", pszFoundFile);
329+
soundemitterbase->AddSoundOverrides(szScriptName);
330+
}
331+
else
332+
{
333+
suffix = "_sounds_custom";
334+
335+
if (Q_strncmp(pszFoundFile, suffix, sizeof(suffix)) == 0)
336+
{
337+
Q_snprintf(szScriptName, sizeof(szScriptName), "scripts/%s", pszFoundFile);
338+
soundemitterbase->AddSoundOverrides(szScriptName);
339+
}
340+
}
341+
}
342+
343+
g_pFullFileSystem->FindClose(hFile);
344+
#endif
345+
317346
#if !defined( CLIENT_DLL )
318347
for ( int i=soundemitterbase->First(); i != soundemitterbase->InvalidIndex(); i=soundemitterbase->Next( i ) )
319348
{

src/game/shared/achievements_hlx.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,15 @@ class CAchievementHLXKillSoldierWithOwnGrenade : public CBaseAchievement
126126
{
127127
CBaseEntity *pThrower = pGrenade->GetThrower();
128128
CBaseEntity *pOriginalThrower = pGrenade->GetOriginalThrower();
129-
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
129+
#ifndef BDSBASE
130+
CBasePlayer* pPlayer = UTIL_GetLocalPlayer();
131+
#endif //BDSBASE
130132
// check if player was most recent thrower, but the victim was the original thrower
131-
if ( ( pPlayer == pThrower ) && ( pOriginalThrower == pVictim ) )
133+
#ifdef BDSBASE
134+
if (pThrower->IsPlayer() && (pOriginalThrower == pVictim))
135+
#else
136+
if ((pPlayer == pThrower) && (pOriginalThrower == pVictim))
137+
#endif //BDSBASE
132138
{
133139
IncrementCount();
134140
}

src/game/shared/basecombatweapon_shared.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,10 @@ void CBaseCombatWeapon::SetActivity( Activity act, float duration )
10371037

10381038
//Adrian: Oh man again...
10391039
#if !defined( CLIENT_DLL ) && (defined( HL2MP ) || defined( PORTAL ))
1040-
SetModel( GetViewModel() );
1040+
#ifdef BDSBASE
1041+
if (GetOwner()->IsPlayer())
1042+
#endif //BDSBASE
1043+
SetModel( GetViewModel() );
10411044
#endif
10421045

10431046
if ( sequence != ACTIVITY_NOT_AVAILABLE )

0 commit comments

Comments
 (0)