8787#include " datacache/imdlcache.h"
8888#include " vstdlib/jobthread.h"
8989
90- #ifdef BDSBASE
90+ #ifdef BDSBASE_NPC
9191#ifdef HL2MP
9292// TDT - Information: Here we include the hl2mp gamerules.
9393#include " hl2mp_gamerules.h"
94- #endif // BDSBASE
94+ #endif
9595#endif // BDSBASE
9696
9797#ifdef HL2_EPISODIC
@@ -261,7 +261,7 @@ int CAI_Manager::NumAIs()
261261
262262// -------------------------------------
263263
264- #ifdef BDSBASE
264+ #ifdef BDSBASE_NPC
265265int CAI_Manager::AddAI (CAI_BaseNPC* pAI)
266266{
267267 m_AIs.AddToTail (pAI);
@@ -657,7 +657,7 @@ void CAI_BaseNPC::Ignite( float flFlameLifetime, bool bNPCOnly, float flSize, bo
657657{
658658 BaseClass::Ignite ( flFlameLifetime, bNPCOnly, flSize, bCalledByLevelDesigner );
659659
660- #ifdef BDSBASE
660+ #ifdef BDSBASE_NPC
661661 /* #ifdef HL2_EPISODIC
662662 if ( AI_IsSinglePlayer() )
663663 {
@@ -813,11 +813,11 @@ int CAI_BaseNPC::OnTakeDamage_Alive( const CTakeDamageInfo &info )
813813 {
814814 // See if the person that injured me is an NPC.
815815 CAI_BaseNPC *pAttacker = dynamic_cast <CAI_BaseNPC *>( info.GetAttacker () );
816- #ifndef BDSBASE
816+ #ifndef BDSBASE_NPC
817817 CBasePlayer* pPlayer = AI_GetSinglePlayer ();
818818#endif // BDSBASE
819819
820- #ifdef BDSBASE
820+ #ifdef BDSBASE_NPC
821821 if (pAttacker && pAttacker->IsAlive () && UTIL_GetNearestPlayer (GetAbsOrigin ()))
822822#else
823823 if (pAttacker && pAttacker->IsAlive () && pPlayer)
@@ -3152,7 +3152,7 @@ void CAI_BaseNPC::UpdateEfficiency( bool bInPVS )
31523152
31533153 // ---------------------------------
31543154
3155- #ifdef BDSBASE
3155+ #ifdef BDSBASE_NPC
31563156 CBasePlayer* pPlayer = UTIL_GetNearestPlayer (GetAbsOrigin ());
31573157#else
31583158 CBasePlayer* pPlayer = AI_GetSinglePlayer ();
@@ -3268,7 +3268,7 @@ void CAI_BaseNPC::UpdateEfficiency( bool bInPVS )
32683268 }
32693269 }
32703270
3271- #ifdef BDSBASE
3271+ #ifdef BDSBASE_NPC
32723272 if (pCurrentSound)
32733273 iSound = pCurrentSound->NextSound ();
32743274 else
@@ -3407,7 +3407,7 @@ void CAI_BaseNPC::UpdateSleepState( bool bInPVS )
34073407{
34083408 if ( GetSleepState () > AISS_AWAKE )
34093409 {
3410- #ifdef BDSBASE
3410+ #ifdef BDSBASE_NPC
34113411 CBasePlayer* pLocalPlayer = UTIL_GetNearestPlayer (GetAbsOrigin ());
34123412#else
34133413 CBasePlayer* pLocalPlayer = AI_GetSinglePlayer ();
@@ -3466,7 +3466,7 @@ void CAI_BaseNPC::UpdateSleepState( bool bInPVS )
34663466 break ;
34673467 }
34683468
3469- #ifdef BDSBASE
3469+ #ifdef BDSBASE_NPC
34703470 if (pCurrentSound)
34713471 iSound = pCurrentSound->NextSound ();
34723472 else
@@ -3618,7 +3618,7 @@ void CAI_BaseNPC::RebalanceThinks()
36183618
36193619 int i;
36203620
3621- #ifdef BDSBASE
3621+ #ifdef BDSBASE_NPC
36223622 CBasePlayer* pPlayer = UTIL_GetNearestPlayer (GetAbsOrigin ());
36233623#else
36243624 CBasePlayer* pPlayer = AI_GetSinglePlayer ();
@@ -3903,7 +3903,7 @@ void CAI_BaseNPC::SetPlayerAvoidState( void )
39033903
39043904 GetPlayerAvoidBounds ( &vMins, &vMaxs );
39053905
3906- #ifdef BDSBASE
3906+ #ifdef BDSBASE_NPC
39073907 CBasePlayer* pLocalPlayer = UTIL_GetNearestPlayer (GetAbsOrigin ());
39083908#else
39093909 CBasePlayer* pLocalPlayer = AI_GetSinglePlayer ();
@@ -4882,7 +4882,7 @@ void CAI_BaseNPC::RunAI( void )
48824882 }
48834883 }
48844884
4885- #ifdef BDSBASE
4885+ #ifdef BDSBASE_NPC
48864886 if (ai_debug_loners.GetBool () && !IsInSquad ())
48874887#else
48884888 if (ai_debug_loners.GetBool () && !IsInSquad () && AI_IsSinglePlayer ())
@@ -4893,7 +4893,7 @@ void CAI_BaseNPC::RunAI( void )
48934893
48944894 vecPoint = EyePosition () + Vector ( 0 , 0 , 12 );
48954895
4896- #ifdef BDSBASE
4896+ #ifdef BDSBASE_NPC
48974897 UTIL_GetNearestPlayer (GetAbsOrigin ())->GetVectors (NULL , &right, NULL );
48984898#else
48994899 UTIL_GetLocalPlayer ()->GetVectors (NULL , &right, NULL );
@@ -8757,7 +8757,7 @@ void CAI_BaseNPC::DrawDebugGeometryOverlays(void)
87578757
87588758 info.SetDamage ( m_iHealth );
87598759 info.SetAttacker ( this );
8760- #ifdef BDSBASE
8760+ #ifdef BDSBASE_NPC
87618761 info.SetInflictor ((CBaseEntity*)this );
87628762#else
87638763 info.SetInflictor ((AI_IsSinglePlayer ()) ? (CBaseEntity*)AI_GetSinglePlayer () : (CBaseEntity*)this );
@@ -9992,7 +9992,7 @@ CBaseEntity *CAI_BaseNPC::FindNamedEntity( const char *name, IEntityFindFilter *
99929992{
99939993 if ( !stricmp ( name, " !player" ))
99949994 {
9995- #ifdef BDSBASE
9995+ #ifdef BDSBASE_NPC
99969996 return UTIL_GetNearestPlayer (GetAbsOrigin ());
99979997#else
99989998 return (CBaseEntity*)AI_GetSinglePlayer ();
@@ -10011,7 +10011,7 @@ CBaseEntity *CAI_BaseNPC::FindNamedEntity( const char *name, IEntityFindFilter *
1001110011 {
1001210012 // FIXME: look at CBaseEntity *CNPCSimpleTalker::FindNearestFriend(bool fPlayer)
1001310013 // punt for now
10014- #ifdef BDSBASE
10014+ #ifdef BDSBASE_NPC
1001510015 return UTIL_GetNearestPlayer (GetAbsOrigin ());
1001610016#else
1001710017 return (CBaseEntity*)AI_GetSinglePlayer ();
@@ -10035,7 +10035,7 @@ CBaseEntity *CAI_BaseNPC::FindNamedEntity( const char *name, IEntityFindFilter *
1003510035 {
1003610036 DevMsg ( " ERROR: \" player\" is no longer used, use \" !player\" in vcd instead!\n " );
1003710037 }
10038- #ifdef BDSBASE
10038+ #ifdef BDSBASE_NPC
1003910039 return UTIL_GetNearestPlayer (GetAbsOrigin ());
1004010040#else
1004110041 return (CBaseEntity*)AI_GetSinglePlayer ();
@@ -11468,7 +11468,7 @@ CAI_BaseNPC::CAI_BaseNPC(void)
1146811468 m_interuptSchedule = NULL ;
1146911469 m_nDebugPauseIndex = 0 ;
1147011470
11471- #ifdef BDSBASE
11471+ #ifdef BDSBASE_NPC
1147211472 SetAIIndex (g_AI_Manager.AddAI (this ));
1147311473#else
1147411474 g_AI_Manager.AddAI (this );
@@ -12016,7 +12016,7 @@ bool CAI_BaseNPC::CineCleanup()
1201612016 {
1201712017 SetLocalOrigin ( origin );
1201812018
12019- #ifdef BDSBASE
12019+ #ifdef BDSBASE_NPC
1202012020 int drop = UTIL_DropToFloor (this , MASK_NPCSOLID, UTIL_GetNearestVisiblePlayer (this ));
1202112021#else
1202212022 int drop = UTIL_DropToFloor (this , MASK_NPCSOLID, UTIL_GetLocalPlayer ());
@@ -12097,7 +12097,7 @@ void CAI_BaseNPC::Teleport( const Vector *newPosition, const QAngle *newAngles,
1209712097
1209812098bool CAI_BaseNPC::FindSpotForNPCInRadius ( Vector *pResult, const Vector &vStartPos, CAI_BaseNPC *pNPC, float radius, bool bOutOfPlayerViewcone )
1209912099{
12100- #ifdef BDSBASE
12100+ #ifdef BDSBASE_NPC
1210112101 CBasePlayer* pPlayer = UTIL_GetNearestPlayer (pNPC->GetAbsOrigin ());
1210212102#else
1210312103 CBasePlayer* pPlayer = AI_GetSinglePlayer ();
@@ -12635,13 +12635,13 @@ bool CAI_BaseNPC::IsPlayerAlly( CBasePlayer *pPlayer )
1263512635{
1263612636 if ( pPlayer == NULL )
1263712637 {
12638- #ifndef BDSBASE
12638+ #ifndef BDSBASE_NPC
1263912639 if (!AI_IsSinglePlayer ())
1264012640 return false ;
1264112641#endif // BDSBASE
1264212642
1264312643 // NULL means single player mode
12644- #ifdef BDSBASE
12644+ #ifdef BDSBASE_NPC
1264512645 pPlayer = UTIL_GetNearestPlayer (GetAbsOrigin ());
1264612646#else
1264712647 pPlayer = UTIL_GetLocalPlayer ();
@@ -12939,7 +12939,7 @@ bool CAI_BaseNPC::FindNearestValidGoalPos( const Vector &vTestPoint, Vector *pRe
1293912939
1294012940 if ( vCandidate != vec3_invalid )
1294112941 {
12942- #ifdef BDSBASE
12942+ #ifdef BDSBASE_NPC
1294312943 AI_Waypoint_t* pPathToPoint = GetPathfinder ()->BuildRoute (GetAbsOrigin (), vCandidate, UTIL_GetNearestPlayer (GetAbsOrigin ()), 5 * 12 , NAV_NONE, true );
1294412944#else
1294512945 AI_Waypoint_t* pPathToPoint = GetPathfinder ()->BuildRoute (GetAbsOrigin (), vCandidate, AI_GetSinglePlayer (), 5 * 12 , NAV_NONE, true );
@@ -14083,7 +14083,7 @@ void CAI_BaseNPC::PlayerHasIlluminatedNPC( CBasePlayer *pPlayer, float flDot )
1408314083 if ( pInteraction->iLoopBreakTriggerMethod & SNPCINT_LOOPBREAK_ON_FLASHLIGHT_ILLUM )
1408414084 {
1408514085 // Only do this in alyx darkness mode
14086- #ifdef BDSBASE
14086+ #ifdef BDSBASE_NPC
1408714087 if (HL2MPRules ()->IsAlyxInDarknessMode ())
1408814088#else
1408914089 if (HL2GameRules ()->IsAlyxInDarknessMode ())
0 commit comments