Further tidy up of code structure.

Aesthetics only.
This commit is contained in:
whoozzem 2013-09-18 19:56:48 +01:00
parent 86f170f31b
commit 7de474d068
36 changed files with 214 additions and 199 deletions

View file

@ -401,9 +401,9 @@ void PlayImpactSound( CBaseEntity *pEntity, trace_t &tr, Vector &vecServerOrigin
{
CLocalPlayerFilter filter;
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
C_BaseEntity::EmitSound( filter, NULL, pbulletImpactSoundName, /*pdata->soundhandles.bulletImpact,*/ &vecOrigin );
C_BaseEntity::EmitSound( filter, NULL, pbulletImpactSoundName, /*pdata->soundhandles.bulletImpact,*/ &vecOrigin );
#else
C_BaseEntity::EmitSound( filter, NULL, pbulletImpactSoundName, pdata->soundhandles.bulletImpact, &vecOrigin );
C_BaseEntity::EmitSound( filter, NULL, pbulletImpactSoundName, pdata->soundhandles.bulletImpact, &vecOrigin );
#endif //Seco7_Enable_Fixed_Multiplayer_AI}
return;

View file

@ -68,7 +68,7 @@ public:
virtual void Init( void ) = 0;
#ifdef Seco7_FIX_VEHICLE_PLAYER_CAMERA_JUDDER
virtual void MP_PostSimulate() = 0;
virtual void MP_PostSimulate() = 0;
#endif //Seco7_FIX_VEHICLE_PLAYER_CAMERA_JUDDER
// Clear any systems between levels

View file

@ -303,7 +303,7 @@ public:
virtual void Shutdown( void );
#ifdef Seco7_FIX_VEHICLE_PLAYER_CAMERA_JUDDER
virtual void MP_PostSimulate();
virtual void MP_PostSimulate();
#endif //Seco7_FIX_VEHICLE_PLAYER_CAMERA_JUDDER
const CViewSetup *GetPlayerViewSetup( ) const;

View file

@ -76,9 +76,9 @@ CBaseHudWeaponSelection::CBaseHudWeaponSelection( const char *pElementName ) : C
s_pInstance = this;
#ifdef Seco7_HAS_WEAPONS_SELECTION_REGARDLESS_OF_SUIT
SetHiddenBits( HIDEHUD_PLAYERDEAD );
SetHiddenBits( HIDEHUD_PLAYERDEAD );
#else
SetHiddenBits( HIDEHUD_WEAPONSELECTION | HIDEHUD_NEEDSUIT | HIDEHUD_PLAYERDEAD | HIDEHUD_INVEHICLE );
SetHiddenBits( HIDEHUD_WEAPONSELECTION | HIDEHUD_NEEDSUIT | HIDEHUD_PLAYERDEAD | HIDEHUD_INVEHICLE );
#endif //Seco7_HAS_WEAPONS_SELECTION_REGARDLESS_OF_SUIT
}

View file

@ -1251,7 +1251,7 @@ void CNPC_Barnacle::LiftPrey( void )
// Height from the barnacle's origin to the point at which it bites
#ifdef Seco7_BARNACLES_CAN_SWALLOW_PLAYERS
float flPBiteZOffset = 10.0;
float flBiteZOffset = 10.0;
#else
float flBiteZOffset = 60.0;
#endif //Seco7_BARNACLES_CAN_SWALLOW_PLAYERS

View file

@ -652,11 +652,11 @@ void CNPC_Strider::PostNPCInit()
RemoveFlag( FL_FLY );
}
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
m_PlayerFreePass.SetPassTarget( UTIL_GetNearestPlayer(GetAbsOrigin()) );
#else
m_PlayerFreePass.SetPassTarget( UTIL_PlayerByIndex(1) );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
m_PlayerFreePass.SetPassTarget( UTIL_GetNearestPlayer(GetAbsOrigin()) );
#else
m_PlayerFreePass.SetPassTarget( UTIL_PlayerByIndex(1) );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
AI_FreePassParams_t freePassParams =
@ -2558,8 +2558,8 @@ int CNPC_Strider::MeleeAttack1Conditions( float flDot, float flDist )
return COND_NONE;
#ifndef Seco7_STRIDERS_ALWAYS_STOMP_IMPALE_PLAYERS
// No more stabbing players.
if ( pEnemy->IsPlayer() && !HasSpawnFlags(SF_CAN_STOMP_PLAYER) )
// No more stabbing players.
if ( pEnemy->IsPlayer() && !HasSpawnFlags(SF_CAN_STOMP_PLAYER) )
return COND_NONE;
#endif
@ -3140,11 +3140,12 @@ int CNPC_Strider::OnTakeDamage_Alive( const CTakeDamageInfo &info )
{
// See if the person that injured me is an NPC.
CAI_BaseNPC *pAttacker = dynamic_cast<CAI_BaseNPC *>( info.GetAttacker() );
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if( pAttacker && pAttacker->IsAlive() && pPlayer )
{
@ -4350,12 +4351,12 @@ void CNPC_Strider::StompHit( int followerBoneIndex )
bool bIsValidTarget = pNPC && pNPC->GetModelPtr();
#ifdef Seco7_STRIDERS_ALWAYS_STOMP_IMPALE_PLAYERS
bIsValidTarget = bIsValidTarget || ( pEnemy && pEnemy->IsPlayer() );
#else
if ( HasSpawnFlags( SF_CAN_STOMP_PLAYER ) )
{
bIsValidTarget = bIsValidTarget || ( pEnemy && pEnemy->IsPlayer() );
}
#else
if ( HasSpawnFlags( SF_CAN_STOMP_PLAYER ) )
{
bIsValidTarget = bIsValidTarget || ( pEnemy && pEnemy->IsPlayer() );
}
#endif
if ( !bIsValidTarget )

View file

@ -443,9 +443,9 @@ void CNPC_Vortigaunt::RunTask( const Task_t *pTask )
{
// Wait for the player to get near (before starting the bugbait sequence)
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( pPlayer != NULL )
@ -645,9 +645,9 @@ int CNPC_Vortigaunt::RangeAttack1Conditions( float flDot, float flDist )
if ( ( GetAbsOrigin() - GetEnemy()->GetAbsOrigin() ).LengthSqr() < Square( AntlionWorkerBurstRadius() ) )
return COND_TOO_CLOSE_TO_ATTACK;
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetEnemy()->GetAbsOrigin());
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetEnemy()->GetAbsOrigin());
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( pPlayer && ( pPlayer->GetAbsOrigin() - GetEnemy()->GetAbsOrigin() ).LengthSqr() < Square( AntlionWorkerBurstRadius() ) )
@ -1701,9 +1701,9 @@ void CNPC_Vortigaunt::MaintainHealSchedule( void )
// For now, we only heal the player
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( pPlayer == NULL )
@ -2363,9 +2363,9 @@ bool CNPC_Vortigaunt::HealGestureHasLOS( void )
{
//For now the player is always our target
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBaseEntity *pTargetEnt = UTIL_GetNearestVisiblePlayer(this);
CBaseEntity *pTargetEnt = UTIL_GetNearestVisiblePlayer(this);
#else
CBaseEntity *pTargetEnt = AI_GetSinglePlayer();
CBaseEntity *pTargetEnt = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( pTargetEnt == NULL )

View file

@ -839,11 +839,11 @@ void CProtoSniper::PaintTarget( const Vector &vecTarget, float flPaintTime )
//-----------------------------------------------------------------------------
bool CProtoSniper::IsPlayerAllySniper()
{
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBaseEntity *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBaseEntity *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBaseEntity *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBaseEntity *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
return IRelationType( pPlayer ) == D_LI;
}
@ -2613,18 +2613,18 @@ Vector CProtoSniper::LeadTarget( CBaseEntity *pTarget )
CBaseEntity *CProtoSniper::PickDeadPlayerTarget()
{
const int iSearchSize = 32;
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBaseEntity *pTarget = UTIL_GetNearestVisiblePlayer(this);
CBaseEntity *pEntities[ iSearchSize ];
int iNumEntities = UTIL_EntitiesInSphere( pEntities, iSearchSize, pTarget->GetAbsOrigin(), 180.0f, 0 );
#else
CBaseEntity *pTarget = AI_GetSinglePlayer();
CBaseEntity *pEntities[ iSearchSize ];
int iNumEntities = UTIL_EntitiesInSphere( pEntities, iSearchSize, AI_GetSinglePlayer()->GetAbsOrigin(), 180.0f, 0 );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBaseEntity *pTarget = UTIL_GetNearestVisiblePlayer(this);
CBaseEntity *pEntities[ iSearchSize ];
int iNumEntities = UTIL_EntitiesInSphere( pEntities, iSearchSize, pTarget->GetAbsOrigin(), 180.0f, 0 );
#else
CBaseEntity *pTarget = AI_GetSinglePlayer();
CBaseEntity *pEntities[ iSearchSize ];
int iNumEntities = UTIL_EntitiesInSphere( pEntities, iSearchSize, AI_GetSinglePlayer()->GetAbsOrigin(), 180.0f, 0 );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
// Not very robust, but doesn't need to be. Randomly select a nearby object in the list that isn't an NPC.
if( iNumEntities > 0 )

View file

@ -234,9 +234,9 @@ void CScriptIntro::InputSetFOVBlendTime( inputdata_t &inputdata )
{
// If we weren't blending, then we need to construct a proper starting point from scratch
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( pPlayer )

View file

@ -853,9 +853,9 @@ void CPropCrane::InputUnlock( inputdata_t &inputdata )
void CPropCrane::InputForcePlayerIn( inputdata_t &inputdata )
{
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = UTIL_PlayerByIndex( 1 );
CBasePlayer *pPlayer = UTIL_PlayerByIndex( 1 );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( pPlayer && !m_hPlayer )

View file

@ -195,8 +195,8 @@ void CPropJeep::Precache( void )
PrecacheScriptSound( "Jeep.GaussCharge" );
#ifdef Seco7_ALLOW_JEEP_HEADLIGHTS
PrecacheScriptSound( "Airboat_headlight_on" );
PrecacheScriptSound( "Airboat_headlight_off" );
PrecacheScriptSound( "Airboat_headlight_on" );
PrecacheScriptSound( "Airboat_headlight_off" );
#endif //Seco7_ALLOW_JEEP_HEADLIGHTS
PrecacheModel( GAUSS_BEAM_SPRITE );

View file

@ -134,11 +134,11 @@ void CPropVehicleViewController::ExitVehicle( int nRole )
//-----------------------------------------------------------------------------
void CPropVehicleViewController::InputForcePlayerIn( inputdata_t &inputdata )
{
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = UTIL_PlayerByIndex(1);
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = UTIL_PlayerByIndex(1);
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( !pPlayer )
return;

View file

@ -239,14 +239,14 @@ void CNPCSimpleTalker::RunTask( const Task_t *pTask )
// fail out if the player looks away or moves away.
if ( !pPlayer || ( pPlayer->GetAbsOrigin() - GetAbsOrigin() ).Length2D() > TALKER_STARE_DIST )
#else
if ( pTask->iTask == TASK_TALKER_CLIENT_STARE && AI_IsSinglePlayer() )
{
// Get edict for one player
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
Assert( pPlayer );
// fail out if the player looks away or moves away.
if ( ( pPlayer->GetAbsOrigin() - GetAbsOrigin() ).Length2D() > TALKER_STARE_DIST )
if ( pTask->iTask == TASK_TALKER_CLIENT_STARE && AI_IsSinglePlayer() )
{
// Get edict for one player
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
Assert( pPlayer );
// fail out if the player looks away or moves away.
if ( ( pPlayer->GetAbsOrigin() - GetAbsOrigin() ).Length2D() > TALKER_STARE_DIST )
#endif //Seco7_Enable_Fixed_Multiplayer_AI
{

View file

@ -298,11 +298,11 @@ IMotionEvent::simresult_e CPhysicsNPCSolver::Simulate( IPhysicsMotionController
if ( pObject->GetGameFlags() & FVPHYSICS_PLAYER_HELD )
{
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
Vector origin;
pObject->GetPosition(&origin,NULL);
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(origin);
Vector origin;
pObject->GetPosition(&origin,NULL);
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(origin);
#else
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( pPlayer )

View file

@ -194,11 +194,11 @@ ConVar player_debug_print_damage( "player_debug_print_damage", "0", FCVAR_CHEAT
void CC_GiveCurrentAmmo( void )
{
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetCommandClient();
#else
CBasePlayer *pPlayer = UTIL_PlayerByIndex(1);
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetCommandClient();
#else
CBasePlayer *pPlayer = UTIL_PlayerByIndex(1);
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if( pPlayer )
{
@ -5081,9 +5081,9 @@ void CBasePlayer::InitialSpawn( void )
void CBasePlayer::Spawn( void )
{
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
KillChatBubble();
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
KillChatBubble();
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
// Needs to be done before weapons are given
if ( Hints() )

View file

@ -253,34 +253,34 @@ public:
IPlayerInfo *GetPlayerInfo() { return &m_PlayerInfo; }
IBotController *GetBotController() { return &m_PlayerInfo; }
#ifdef Seco7_USE_PLAYERCLASSES
// Here are the players speed is set:
void SetWalkSpeed(int WalkSpeed);
void SetNormSpeed(int NormSpeed);
void SetSprintSpeed(int SprintSpeed);
void SetJumpHeight(float JumpHeight);
#ifdef Seco7_USE_PLAYERCLASSES
// Here are the players speed is set:
void SetWalkSpeed(int WalkSpeed);
void SetNormSpeed(int NormSpeed);
void SetSprintSpeed(int SprintSpeed);
void SetJumpHeight(float JumpHeight);
// Spielergeschwindigkeit:
int m_iWalkSpeed;
int m_iNormSpeed;
int m_iSprintSpeed;
CNetworkVar( float, m_iJumpHeight );
int GetWalkSpeed();
int GetNormSpeed();
int GetSprintSpeed();
float GetJumpHeight();
#endif //Seco7_USE_PLAYERCLASSES
// Spielergeschwindigkeit:
int m_iWalkSpeed;
int m_iNormSpeed;
int m_iSprintSpeed;
#ifdef Seco7_ENABLE_FAKE_PASSENGER_SEATS
void SafeVehicleExit(CBasePlayer *pPlayer);
#endif //Seco7_ENABLE_FAKE_PASSENGER_SEATS
CNetworkVar( float, m_iJumpHeight );
int GetWalkSpeed();
int GetNormSpeed();
int GetSprintSpeed();
float GetJumpHeight();
#endif //Seco7_USE_PLAYERCLASSES
#ifdef Seco7_ENABLE_FAKE_PASSENGER_SEATS
void SafeVehicleExit(CBasePlayer *pPlayer);
#endif //Seco7_ENABLE_FAKE_PASSENGER_SEATS
#ifdef Seco7_MULTIPLAYER_LEVEL_TRANSITIONS
bool m_bTransition; //4WH - Information: This is important as it allows the game to save each players progress over a map change. Create the booleans required for transitions to work.
bool m_bTransitionTeleported; //4WH - Information: This is important as it allows the game to save each players progress over a map change. Create the booleans required for transitions to work.
#endif //Seco7_MULTIPLAYER_LEVEL_TRANSITIONS
#ifdef Seco7_MULTIPLAYER_LEVEL_TRANSITIONS
bool m_bTransition; //4WH - Information: This is important as it allows the game to save each players progress over a map change. Create the booleans required for transitions to work.
bool m_bTransitionTeleported; //4WH - Information: This is important as it allows the game to save each players progress over a map change. Create the booleans required for transitions to work.
#endif //Seco7_MULTIPLAYER_LEVEL_TRANSITIONS
virtual void SetModel( const char *szModelName );
void SetBodyPitch( float flPitch );
@ -335,12 +335,12 @@ void SafeVehicleExit(CBasePlayer *pPlayer);
void MakeTracer( const Vector &vecTracerSrc, const trace_t &tr, int iTracerType );
void DoImpactEffect( trace_t &tr, int nDamageType );
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
void MakeChatBubble(int chatbubble);
void KillChatBubble();
void CheckChatBubble( CUserCmd *cmd );
EHANDLE m_hChatBubble;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
void MakeChatBubble(int chatbubble);
void KillChatBubble();
void CheckChatBubble( CUserCmd *cmd );
EHANDLE m_hChatBubble;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#if !defined( NO_ENTITY_PREDICTION )
void AddToPlayerSimulationList( CBaseEntity *other );

View file

@ -433,9 +433,9 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
Assert( g_pGameMovement );
g_pGameMovement->ProcessMovement( player, g_pMoveData );
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
player->CheckChatBubble(ucmd);
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
player->CheckChatBubble(ucmd);
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
}
else

View file

@ -24,11 +24,11 @@ void Pickup_ForcePlayerToDropThisObject( CBaseEntity *pTarget )
if ( pPhysics->GetGameFlags() & FVPHYSICS_PLAYER_HELD )
{
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(pTarget->GetAbsOrigin());
#else
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#else
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
pPlayer->ForceDropOfCarriedPhysObjects( pTarget );
}

View file

@ -310,7 +310,7 @@ void CEnvSoundscape::UpdateForPlayer( ss_update_t &update )
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#else
// Don't use GetLocalPlayer(), because that prevents multiplayer games using this for testing with a single client in the game
// Don't use GetLocalPlayer(), because that prevents multiplayer games using this for testing with a single client in the game
CBasePlayer *pPlayer = UTIL_PlayerByIndex(1);
#endif //Seco7_Enable_Fixed_Multiplayer_AI

View file

@ -29,7 +29,7 @@ CBaseEntity* MoveToRandomSpot( CBaseEntity *pEnt )
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
UTIL_SetOrigin( pEnt, GetRandomSpot() );
#else
CBasePlayer *pLocalPlayer = UTIL_GetLocalPlayer();
CBasePlayer *pLocalPlayer = UTIL_GetLocalPlayer();
if ( pLocalPlayer )
{
Vector vForward;

View file

@ -275,11 +275,11 @@ void CTriggerPortal::DisableForIncomingEntity( CBaseEntity *pEntity )
// Start thinking, and remove the other as soon as it's not touching me.
// Needs to be done in addition to EndTouch, because entities may move fast
// enough through the portal to come out not touching the other portal.
#ifdef Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
SetContextThink( &CTriggerPortal::DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#else
SetContextThink( DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#endif //Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
#ifdef Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
SetContextThink( &CTriggerPortal::DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#else
SetContextThink( DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#endif //Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
}
//-----------------------------------------------------------------------------
@ -302,11 +302,11 @@ void CTriggerPortal::DisabledThink( void )
m_hDisabledForEntities.Remove(i);
}
}
#ifdef Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
SetContextThink( &CTriggerPortal::DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#else
SetContextThink( DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#endif //Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
#ifdef Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
SetContextThink( &CTriggerPortal::DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#else
SetContextThink( DisabledThink, gpGlobals->curtime + 0.1, TRIGGER_DISABLED_THINK );
#endif //Seco7_ENABLE_PORTAL_CONTENT_MOUNTING
}
//-----------------------------------------------------------------------------

View file

@ -2616,11 +2616,11 @@ CBasePlayer *pPlayer = UTIL_PlayerByIndex( 1 );
if ( m_fDangerousTimer != 0.0f )
{
// There's a dangerous timer. Save if we have enough hitpoints.
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = UTIL_PlayerByIndex( 1 );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#else
CBasePlayer *pPlayer = UTIL_PlayerByIndex( 1 );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if (pPlayer && pPlayer->GetHealth() >= m_minHitPoints)
@ -3496,9 +3496,10 @@ void CTriggerCamera::Disable( void )
}
//4WH - Null Pointers: On ep2_outland_01 the game would crash as it didn't find a player, so define them as the nearest player.
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *m_hPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *m_hPlayer = UTIL_GetNearestPlayer(GetAbsOrigin());
#endif //Seco7_Enable_Fixed_Multiplayer_AI
//return the player to previous takedamage state
m_hPlayer->m_takedamage = m_nOldTakeDamage;

View file

@ -23,9 +23,9 @@
#define GAMEMOVEMENT_JUMP_TIME 510.0f //ms approx - based on the 21 unit height jump
#ifdef Seco7_USE_PLAYERCLASSES
#define GAMEMOVEMENT_JUMP_HEIGHT player->GetJumpHeight()
#define GAMEMOVEMENT_JUMP_HEIGHT player->GetJumpHeight()
#else
#define GAMEMOVEMENT_JUMP_HEIGHT 21.0f // units
#define GAMEMOVEMENT_JUMP_HEIGHT 21.0f // units
#endif //Seco7_USE_PLAYERCLASSES
#define GAMEMOVEMENT_TIME_TO_UNDUCK ( TIME_TO_UNDUCK * 1000.0f ) // ms

View file

@ -45,7 +45,7 @@ public:
virtual bool CanAccelerate( void );
#ifdef Seco7_USE_CSS_LADDERS
virtual unsigned int PlayerSolidMask( bool brushOnly = false );
virtual unsigned int PlayerSolidMask( bool brushOnly = false );
#endif //Seco7_USE_CSS_LADDERS
private:

View file

@ -388,9 +388,9 @@ void CWeaponAR2::DelayedAttack( void )
// Register a muzzleflash for the AI
pOwner->DoMuzzleFlash();
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
#ifndef CLIENT_DLL
pOwner->SetMuzzleFlashTime( gpGlobals->curtime + 0.5 );
#endif
#ifndef CLIENT_DLL
pOwner->SetMuzzleFlashTime( gpGlobals->curtime + 0.5 );
#endif
#endif //Seco7_Enable_Fixed_Multiplayer_AI
WeaponSound( WPN_DOUBLE );

View file

@ -58,9 +58,9 @@ public:
void HandleAnimEventMeleeHit( animevent_t *pEvent, CBaseCombatCharacter *pOperator );
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
virtual int WeaponMeleeAttack1Condition( float flDot, float flDist );
virtual int WeaponMeleeAttack1Condition( float flDot, float flDist );
#else
int WeaponMeleeAttack1Condition( float flDot, float flDist );
int WeaponMeleeAttack1Condition( float flDot, float flDist );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#endif

View file

@ -14,9 +14,9 @@
#include "basecombatweapon_shared.h"
#include "hl2mp_weapon_parse.h"
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
#ifndef CLIENT_DLL
#include "AI_BaseNPC.h"
#endif
#ifndef CLIENT_DLL
#include "AI_BaseNPC.h"
#endif
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#if defined( CLIENT_DLL )

View file

@ -5,9 +5,9 @@
//=============================================================================//
#ifdef Seco7_PLAYER_MOVEMENT_CAMERA_BOB
#include "weapon_hl2mpbasehlmpcombatweapon.h"
#include "weapon_hl2mpbasehlmpcombatweapon.h"
#else
#include "weapon_hl2mpbase.h"
#include "weapon_hl2mpbase.h"
#endif //Seco7_PLAYER_MOVEMENT_CAMERA_BOB
#ifndef BASEHLCOMBATWEAPON_H
@ -24,9 +24,9 @@
// Machine gun base class
//=========================================================
#ifdef Seco7_PLAYER_MOVEMENT_CAMERA_BOB
class CHL2MPMachineGun : public CBaseHL2MPCombatWeapon
class CHL2MPMachineGun : public CBaseHL2MPCombatWeapon
#else
class CHL2MPMachineGun : public CWeaponHL2MPBase
class CHL2MPMachineGun : public CWeaponHL2MPBase
#endif //Seco7_PLAYER_MOVEMENT_CAMERA_BOB
{
public:

View file

@ -33,11 +33,12 @@ public:
DECLARE_NETWORKCLASS();
DECLARE_PREDICTABLE();
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
#ifndef CLIENT_DLL
int CapabilitiesGet( void ) { return bits_CAP_WEAPON_MELEE_ATTACK1; }
#endif
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
#ifndef CLIENT_DLL
int CapabilitiesGet( void ) { return bits_CAP_WEAPON_MELEE_ATTACK1; }
#endif
#endif //Seco7_Enable_Fixed_Multiplayer_AI
virtual void Spawn( void );
virtual void Precache( void );

View file

@ -26,9 +26,10 @@ float PlayerPickupGetHeldObjectMass( CBaseEntity *pPickupControllerEntity, IPhys
float PhysCannonGetHeldObjectMass( CBaseCombatWeapon *pActiveWeapon, IPhysicsObject *pHeldObject );
CBaseEntity *PhysCannonGetHeldEntity( CBaseCombatWeapon *pActiveWeapon );
#ifdef Seco7_ALLOW_SUPER_GRAVITY_GUN
CBaseEntity *GetPlayerHeldEntity( CBasePlayer *pPlayer );
bool PhysCannonAccountableForObject( CBaseCombatWeapon *pPhysCannon, CBaseEntity *pObject );
CBaseEntity *GetPlayerHeldEntity( CBasePlayer *pPlayer );
bool PhysCannonAccountableForObject( CBaseCombatWeapon *pPhysCannon, CBaseEntity *pObject );
#endif //Seco7_ALLOW_SUPER_GRAVITY_GUN
#endif // WEAPON_PHYSCANNON_H

View file

@ -199,7 +199,7 @@ void CMissile::Spawn( void )
SetNextThink( gpGlobals->curtime + 0.3f );
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
SetDamage( EXPLOSION_DAMAGE );
SetDamage( EXPLOSION_DAMAGE );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
m_takedamage = DAMAGE_YES;

View file

@ -37,10 +37,10 @@ class CMissile : public CBaseCombatCharacter
DECLARE_CLASS( CMissile, CBaseCombatCharacter );
public:
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
static const int EXPLOSION_RADIUS = 200;
static const int EXPLOSION_DAMAGE = 200;
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
static const int EXPLOSION_RADIUS = 200;
static const int EXPLOSION_DAMAGE = 200;
#endif //Seco7_Enable_Fixed_Multiplayer_AI
CMissile();
~CMissile();
@ -73,12 +73,12 @@ static const int EXPLOSION_RADIUS = 200;
CHandle<CWeaponRPG> m_hOwner;
static CMissile *Create( const Vector &vecOrigin, const QAngle &vecAngles, edict_t *pentOwner );
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
void CreateDangerSounds( bool bState ){ m_bCreateDangerSounds = bState; }
static void AddCustomDetonator( CBaseEntity *pEntity, float radius, float height = -1 );
static void RemoveCustomDetonator( CBaseEntity *pEntity );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
void CreateDangerSounds( bool bState ){ m_bCreateDangerSounds = bState; }
static void AddCustomDetonator( CBaseEntity *pEntity, float radius, float height = -1 );
static void RemoveCustomDetonator( CBaseEntity *pEntity );
#endif //Seco7_Enable_Fixed_Multiplayer_AI
protected:
virtual void DoExplosion();
@ -228,9 +228,8 @@ public:
#ifndef CLIENT_DLL
bool WeaponLOSCondition( const Vector &ownerPos, const Vector &targetPos, bool bSetConditions );
int WeaponRangeAttack1Condition( float flDot, float flDist );
void Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator );
#endif
#endif
#endif //Seco7_Enable_Fixed_Multiplayer_AI
void StartGuiding( void );

View file

@ -172,6 +172,16 @@ acttable_t CWeaponStunStick::m_acttable[] =
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
{ ACT_MELEE_ATTACK1, ACT_MELEE_ATTACK_SWING, true },
{ ACT_IDLE_ANGRY, ACT_IDLE_ANGRY_MELEE, true },
{ ACT_RANGE_ATTACK1, ACT_RANGE_ATTACK_SLAM, true },
{ ACT_HL2MP_IDLE, ACT_HL2MP_IDLE_MELEE, false },
{ ACT_HL2MP_RUN, ACT_HL2MP_RUN_MELEE, false },
{ ACT_HL2MP_IDLE_CROUCH, ACT_HL2MP_IDLE_CROUCH_MELEE, false },
{ ACT_HL2MP_WALK_CROUCH, ACT_HL2MP_WALK_CROUCH_MELEE, false },
{ ACT_HL2MP_GESTURE_RANGE_ATTACK, ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE, false },
{ ACT_HL2MP_GESTURE_RELOAD, ACT_HL2MP_GESTURE_RELOAD_MELEE, false },
{ ACT_HL2MP_JUMP, ACT_HL2MP_JUMP_MELEE, false },
#endif //Seco7_Enable_Fixed_Multiplayer_AI
};

View file

@ -575,11 +575,12 @@ Vector CParticleSystemQuery::GetLocalPlayerPos( void )
return vec3_origin;
return pPlayer->WorldSpaceCenter();
#else
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetLocalPlayer(); //AI Patch Replacment: CBasePlayer *pPlayer = AI_GetSinglePlayer();
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetLocalPlayer(); //AI Patch Replacment: CBasePlayer *pPlayer = AI_GetSinglePlayer();
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( !pPlayer )
return vec3_origin;
@ -600,11 +601,12 @@ void CParticleSystemQuery::GetLocalPlayerEyeVectors( Vector *pForward, Vector *p
}
pPlayer->EyeVectors( pForward, pRight, pUp );
#else
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifdef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#else
CBasePlayer *pPlayer = AI_GetSinglePlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if ( !pPlayer )
{

View file

@ -769,9 +769,9 @@ bool ShouldRemoveThisRagdoll( CBaseAnimating *pRagdoll )
}
#else
#ifndef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
#ifndef Seco7_Enable_Fixed_Multiplayer_AI
CBasePlayer *pPlayer = UTIL_GetLocalPlayer();
#endif //Seco7_Enable_Fixed_Multiplayer_AI
if( !UTIL_FindClientInPVS( pRagdoll->edict() ) )
{

View file

@ -41,9 +41,9 @@ public:
void Reset()
{
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
chatbubble = 0;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
chatbubble = 0;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
command_number = 0;
tick_count = 0;
@ -70,9 +70,9 @@ chatbubble = 0;
if ( this == &src )
return *this;
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
chatbubble = src.chatbubble;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
chatbubble = src.chatbubble;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
command_number = src.command_number;
tick_count = src.tick_count;
@ -107,10 +107,10 @@ chatbubble = src.chatbubble;
CRC32_t crc;
CRC32_Init( &crc );
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
CRC32_ProcessBuffer( &crc, &chatbubble, sizeof ( chatbubble ) );
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
CRC32_ProcessBuffer( &crc, &chatbubble, sizeof ( chatbubble ) );
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
CRC32_ProcessBuffer( &crc, &command_number, sizeof( command_number ) );
CRC32_ProcessBuffer( &crc, &tick_count, sizeof( tick_count ) );
@ -169,9 +169,9 @@ CRC32_ProcessBuffer( &crc, &chatbubble, sizeof ( chatbubble ) );
short mousedx; // mouse accum in x from create move
short mousedy; // mouse accum in y from create move
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
short chatbubble;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
#ifdef Seco7_MULTIPLAYER_CHAT_BUBBLES
short chatbubble;
#endif //Seco7_MULTIPLAYER_CHAT_BUBBLES
// Client only, tracks whether we've predicted this command at least once
bool hasbeenpredicted;