From 59c7ccc5abe70743995e7c0242f4a6f4ad8f4d63 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Wed, 20 Jul 2022 13:52:49 +0500 Subject: [PATCH 1/7] Turn on fixes. --- CMakeLists.txt | 16 ++++++++-------- dlls/game.cpp | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d0a981..dddaef86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,15 +58,15 @@ else() option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) endif() -option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" OFF) +option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" ON) option(CLIENT_WEAPONS "Enable client local weapons prediction" ON) -option(CROWBAR_IDLE_ANIM "Enable crowbar idle animation" OFF) -option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" OFF) -option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" OFF) -option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" OFF) -option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" OFF) -option(HANDGRENADE_DEPLOY_FIX "Enable handgrenade deploy animation fix after finishing a throw" OFF) -option(WEAPONS_ANIMATION_TIMES_FIX "Enable animation times fix for some weapons" OFF) +option(CROWBAR_IDLE_ANIM "Enable crowbar idle animation" ON) +option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" ON) +option(CROWBAR_FIX_RAPID_CROWBAR "Enable rapid crowbar fix" ON) +option(GAUSS_OVERCHARGE_FIX "Enable gauss overcharge fix" ON) +option(TRIPMINE_BEAM_DUPLICATION_FIX "Enable fix of tripmine beam duplication on level transition" ON) +option(HANDGRENADE_DEPLOY_FIX "Enable handgrenade deploy animation fix after finishing a throw" ON) +option(WEAPONS_ANIMATION_TIMES_FIX "Enable animation times fix for some weapons" ON) option(OEM_BUILD "Enable OEM Build" OFF) option(HLDEMO_BUILD "Enable Demo Build" OFF) diff --git a/dlls/game.cpp b/dlls/game.cpp index 690256c2..ef671df0 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -33,11 +33,11 @@ cvar_t friendlyfire = { "mp_friendlyfire","0", FCVAR_SERVER }; cvar_t falldamage = { "mp_falldamage","0", FCVAR_SERVER }; cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER }; -cvar_t chargerfix = { "chargerfix", "0", FCVAR_SERVER }; -cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER }; -cvar_t explosionfix = { "explosionfix", "0", FCVAR_SERVER }; +cvar_t chargerfix = { "chargerfix", "1", FCVAR_SERVER }; +cvar_t satchelfix = { "satchelfix", "1", FCVAR_SERVER }; +cvar_t explosionfix = { "explosionfix", "1", FCVAR_SERVER }; cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER }; -cvar_t corpsephysics = { "corpsephysics", "0", FCVAR_SERVER }; +cvar_t corpsephysics = { "corpsephysics", "1", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; From 2f7c40841f3b9bf08f39e78130b8ad2489209389 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Wed, 20 Jul 2022 14:24:04 +0500 Subject: [PATCH 2/7] Turn off selfgauss. --- dlls/game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index ef671df0..5f0c5176 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -32,7 +32,7 @@ cvar_t timelimit = { "mp_timelimit","0", FCVAR_SERVER }; cvar_t friendlyfire = { "mp_friendlyfire","0", FCVAR_SERVER }; cvar_t falldamage = { "mp_falldamage","0", FCVAR_SERVER }; cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; -cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER }; +cvar_t selfgauss = { "selfgauss", "0", FCVAR_SERVER }; cvar_t chargerfix = { "chargerfix", "1", FCVAR_SERVER }; cvar_t satchelfix = { "satchelfix", "1", FCVAR_SERVER }; cvar_t explosionfix = { "explosionfix", "1", FCVAR_SERVER }; From d30986e32862cce1edc8f0f4d57a078125002acb Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 6 Aug 2022 17:42:09 +0300 Subject: [PATCH 3/7] Barney checks for player to avoid friendly fire (#305) --- dlls/barney.cpp | 102 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 1 deletion(-) diff --git a/dlls/barney.cpp b/dlls/barney.cpp index dd91de44..d610078a 100644 --- a/dlls/barney.cpp +++ b/dlls/barney.cpp @@ -27,6 +27,7 @@ #include "scripted.h" #include "weapons.h" #include "soundent.h" +#include "plane.h" //========================================================= // Monster's Anim Events Go Here @@ -40,6 +41,13 @@ #define BARNEY_BODY_GUNDRAWN 1 #define BARNEY_BODY_GUNGONE 2 +#define bits_COND_BARNEY_NOFIRE ( bits_COND_SPECIAL1 ) + +enum +{ + TASK_BARNEY_CHECK_FIRE = LAST_COMMON_TASK + 1, +}; + class CBarney : public CTalkMonster { public: @@ -73,6 +81,8 @@ public: void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType); void Killed( entvars_t *pevAttacker, int iGib ); + BOOL NoFriendlyFire(); + virtual int Save( CSave &save ); virtual int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; @@ -201,19 +211,57 @@ Schedule_t slIdleBaStand[] = }, }; +// primary range attack +Task_t tlBaRangeAttack1[] = +{ + { TASK_STOP_MOVING, 0 }, + { TASK_FACE_ENEMY, (float)0 }, + { TASK_BARNEY_CHECK_FIRE, (float)0 }, + { TASK_RANGE_ATTACK1, (float)0 }, +}; + +Schedule_t slBaRangeAttack1[] = +{ + { + tlBaRangeAttack1, + ARRAYSIZE( tlBaRangeAttack1 ), + bits_COND_NEW_ENEMY | + bits_COND_ENEMY_DEAD | + bits_COND_LIGHT_DAMAGE | + bits_COND_HEAVY_DAMAGE | + bits_COND_ENEMY_OCCLUDED | + bits_COND_NO_AMMO_LOADED | + bits_COND_BARNEY_NOFIRE | + bits_COND_HEAR_SOUND, + bits_SOUND_DANGER, + "Range Attack1" + }, +}; + DEFINE_CUSTOM_SCHEDULES( CBarney ) { slBaFollow, slBarneyEnemyDraw, slBaFaceTarget, slIdleBaStand, + slBaRangeAttack1, }; IMPLEMENT_CUSTOM_SCHEDULES( CBarney, CTalkMonster ) void CBarney::StartTask( Task_t *pTask ) { - CTalkMonster::StartTask( pTask ); + switch ( pTask->iTask ) { + case TASK_BARNEY_CHECK_FIRE: + if( !NoFriendlyFire() ) + { + SetConditions( bits_COND_BARNEY_NOFIRE ); + } + TaskComplete(); + break; + default: + CTalkMonster::StartTask( pTask ); + } } void CBarney::RunTask( Task_t *pTask ) @@ -663,6 +711,8 @@ Schedule_t *CBarney::GetScheduleOfType( int Type ) } else return psched; + case SCHED_RANGE_ATTACK1: + return slBaRangeAttack1; } return CTalkMonster::GetScheduleOfType( Type ); @@ -764,6 +814,56 @@ void CBarney::DeclineFollowing( void ) PlaySentence( "BA_POK", 2, VOL_NORM, ATTN_NORM ); } +BOOL CBarney::NoFriendlyFire() +{ + if( m_hEnemy != 0 ) + { + UTIL_MakeVectors( UTIL_VecToAngles( m_hEnemy->Center() - pev->origin ) ); + } + else + { + // if there's no enemy, pretend there's a friendly in the way, so the grunt won't shoot. + return FALSE; + } + + CPlane backPlane; + CPlane leftPlane; + CPlane rightPlane; + + Vector vecLeftSide; + Vector vecRightSide; + Vector v_left; + Vector v_dir; + + v_dir = gpGlobals->v_right * ( pev->size.x * 1.5f ); + vecLeftSide = pev->origin - v_dir; + vecRightSide = pev->origin + v_dir; + + v_left = gpGlobals->v_right * -1.0f; + + leftPlane.InitializePlane( gpGlobals->v_right, vecLeftSide ); + rightPlane.InitializePlane( v_left, vecRightSide ); + backPlane.InitializePlane( gpGlobals->v_forward, pev->origin ); + + for( int k = 1; k <= gpGlobals->maxClients; k++ ) + { + CBaseEntity* pPlayer = UTIL_PlayerByIndex(k); + if (pPlayer && pPlayer->IsPlayer() && IRelationship(pPlayer) == R_AL && pPlayer->IsAlive()) + { + if( backPlane.PointInFront( pPlayer->pev->origin ) && + leftPlane.PointInFront( pPlayer->pev->origin ) && + rightPlane.PointInFront( pPlayer->pev->origin ) ) + { + //ALERT(at_aiconsole, "%s: Ally player at fire plane!\n", STRING(pev->classname)); + // player is in the check volume! Don't shoot! + return FALSE; + } + } + } + + return TRUE; +} + //========================================================= // DEAD BARNEY PROP // From 19e5c784afb3778589520874b774ed1c303ce2ad Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 6 Aug 2022 17:42:21 +0300 Subject: [PATCH 4/7] Fix geiger sounds interrupting other sounds (#303) --- cl_dll/geiger.cpp | 6 +++++- dlls/player.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cl_dll/geiger.cpp b/cl_dll/geiger.cpp index 89d2b951..daf13bbe 100644 --- a/cl_dll/geiger.cpp +++ b/cl_dll/geiger.cpp @@ -25,6 +25,7 @@ #include #include "parsemsg.h" +#include "event_api.h" DECLARE_MESSAGE( m_Geiger, Geiger ) @@ -175,7 +176,10 @@ int CHudGeiger::Draw( float flTime ) j += rand() & 1; sprintf( sz, "player/geiger%d.wav", j + 1 ); - PlaySound( sz, flvol ); + vec3_t view_ofs; + cl_entity_t *pthisplayer = gEngfuncs.GetLocalPlayer(); + gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs ); + gEngfuncs.pEventAPI->EV_PlaySound( pthisplayer->index, pthisplayer->origin + view_ofs, CHAN_STATIC, sz, flvol, ATTN_NORM, 0, PITCH_NORM ); } } diff --git a/dlls/player.cpp b/dlls/player.cpp index 234cfb31..3e4291e2 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2179,7 +2179,7 @@ Things powered by the battery // if in range of radiation source, ping geiger counter -#define GEIGERDELAY 0.25f +#define GEIGERDELAY 0.28f void CBasePlayer::UpdateGeigerCounter( void ) { From 03cdf7a0e1f41477f1ecce4470b1aa490fbb9fa8 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 6 Aug 2022 17:42:50 +0300 Subject: [PATCH 5/7] Restore room sound type (#304) --- dlls/player.cpp | 21 +++++++++++++++++---- dlls/player.h | 5 +++-- dlls/sound.cpp | 24 ++++++++---------------- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index 3e4291e2..800083ca 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -124,9 +124,9 @@ TYPEDESCRIPTION CBasePlayer::m_playerSaveData[] = //DEFINE_FIELD( CBasePlayer, m_flStopExtraSoundTime, FIELD_TIME ), //DEFINE_FIELD( CBasePlayer, m_fKnownItem, FIELD_INTEGER ), // reset to zero on load //DEFINE_FIELD( CBasePlayer, m_iPlayerSound, FIELD_INTEGER ), // Don't restore, set in Precache() - //DEFINE_FIELD( CBasePlayer, m_pentSndLast, FIELD_EDICT ), // Don't restore, client needs reset - //DEFINE_FIELD( CBasePlayer, m_flSndRoomtype, FIELD_FLOAT ), // Don't restore, client needs reset - //DEFINE_FIELD( CBasePlayer, m_flSndRange, FIELD_FLOAT ), // Don't restore, client needs reset + DEFINE_FIELD( CBasePlayer, m_pentSndLast, FIELD_EDICT ), + DEFINE_FIELD( CBasePlayer, m_SndRoomtype, FIELD_INTEGER ), + DEFINE_FIELD( CBasePlayer, m_flSndRange, FIELD_FLOAT ), //DEFINE_FIELD( CBasePlayer, m_fNewAmmo, FIELD_INTEGER ), // Don't restore, client needs reset //DEFINE_FIELD( CBasePlayer, m_flgeigerRange, FIELD_FLOAT ), // Don't restore, reset in Precache() //DEFINE_FIELD( CBasePlayer, m_flgeigerDelay, FIELD_FLOAT ), // Don't restore, reset in Precache() @@ -2818,6 +2818,7 @@ void CBasePlayer::Spawn( void ) pev->fov = m_iFOV = 0;// init field of view. m_iClientFOV = -1; // make sure fov reset is sent + m_ClientSndRoomtype = -1; m_flNextDecalTime = 0;// let this player decal as soon as he spawns. @@ -2968,6 +2969,8 @@ int CBasePlayer::Restore( CRestore &restore ) pev->fixangle = TRUE; // turn this way immediately + m_ClientSndRoomtype = -1; + // Copied from spawn() for now m_bloodColor = BLOOD_COLOR_RED; @@ -3353,6 +3356,7 @@ void CBasePlayer::ForceClientDllUpdate( void ) m_iClientBattery = -1; m_iClientHideHUD = -1; // Vit_amiN: forcing to update m_iClientFOV = -1; // Vit_amiN: force client weapons to be sent + m_ClientSndRoomtype = -1; m_iTrain |= TRAIN_NEW; // Force new train message. m_fWeapon = FALSE; // Force weapon send m_fKnownItem = FALSE; // Force weaponinit messages. @@ -3361,7 +3365,6 @@ void CBasePlayer::ForceClientDllUpdate( void ) memset( m_rgAmmoLast, 0, sizeof( m_rgAmmoLast )); // a1ba: Force update AmmoX - // Now force all the necessary messages // to be sent. UpdateClientData(); @@ -4125,6 +4128,16 @@ void CBasePlayer::UpdateClientData( void ) m_flNextSBarUpdateTime = gpGlobals->time + 0.2f; } + // Send new room type to client. + if (m_ClientSndRoomtype != m_SndRoomtype) + { + m_ClientSndRoomtype = m_SndRoomtype; + + MESSAGE_BEGIN(MSG_ONE, SVC_ROOMTYPE, NULL, edict()); + WRITE_SHORT((short)m_SndRoomtype); // sequence number + MESSAGE_END(); + } + // Send the current bhopcap state. if( !m_bSentBhopcap ) { diff --git a/dlls/player.h b/dlls/player.h index d2f5d945..d52b5dbe 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -115,9 +115,10 @@ public: int m_afButtonPressed; int m_afButtonReleased; - edict_t *m_pentSndLast; // last sound entity to modify player room type - float m_flSndRoomtype; // last roomtype set by sound entity + edict_t *m_pentSndLast; // last sound entity to modify player room type + int m_SndRoomtype; // last roomtype set by sound entity float m_flSndRange; // dist from player to sound entity + int m_ClientSndRoomtype; float m_flFallVelocity; diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 3dbd097a..2607d2b6 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -814,7 +814,7 @@ public: static TYPEDESCRIPTION m_SaveData[]; float m_flRadius; - float m_flRoomtype; + int m_Roomtype; }; LINK_ENTITY_TO_CLASS( env_sound, CEnvSound ) @@ -822,7 +822,7 @@ LINK_ENTITY_TO_CLASS( env_sound, CEnvSound ) TYPEDESCRIPTION CEnvSound::m_SaveData[] = { DEFINE_FIELD( CEnvSound, m_flRadius, FIELD_FLOAT ), - DEFINE_FIELD( CEnvSound, m_flRoomtype, FIELD_FLOAT ), + DEFINE_FIELD( CEnvSound, m_Roomtype, FIELD_INTEGER ), }; IMPLEMENT_SAVERESTORE( CEnvSound, CPointEntity ) @@ -836,7 +836,7 @@ void CEnvSound::KeyValue( KeyValueData *pkvd ) } if( FStrEq( pkvd->szKeyName, "roomtype" ) ) { - m_flRoomtype = atof( pkvd->szValue ); + m_Roomtype = atoi( pkvd->szValue ); pkvd->fHandled = TRUE; } } @@ -902,7 +902,7 @@ void CEnvSound::Think( void ) { // this is the entity currently affecting player, check // for validity - if( pPlayer->m_flSndRoomtype != 0 && pPlayer->m_flSndRange != 0 ) + if( pPlayer->m_SndRoomtype != 0 && pPlayer->m_flSndRange != 0 ) { // we're looking at a valid sound entity affecting // player, make sure it's still valid, update range @@ -914,11 +914,11 @@ void CEnvSound::Think( void ) else { // current sound entity affecting player is no longer valid, - // flag this state by clearing room_type and range. + // flag this state by clearing source handle and range. // NOTE: we do not actually change the player's room_type // NOTE: until we have a new valid room_type to change it to. pPlayer->m_flSndRange = 0; - pPlayer->m_flSndRoomtype = 0; + pPlayer->m_pentSndLast = 0; goto env_sound_Think_slow; } } @@ -938,18 +938,10 @@ void CEnvSound::Think( void ) { // new entity is closer to player, so it wins. pPlayer->m_pentSndLast = ENT( pev ); - pPlayer->m_flSndRoomtype = m_flRoomtype; + pPlayer->m_SndRoomtype = m_Roomtype; pPlayer->m_flSndRange = flRange; - // send room_type command to player's server. - // this should be a rare event - once per change of room_type - // only! - - //CLIENT_COMMAND( pentPlayer, "room_type %f", m_flRoomtype ); - - MESSAGE_BEGIN( MSG_ONE, SVC_ROOMTYPE, NULL, pentPlayer ); // use the magic #1 for "one client" - WRITE_SHORT( (short)m_flRoomtype ); // sequence number - MESSAGE_END(); + // New room type is sent to player in CBasePlayer::UpdateClientData. // crank up nextthink rate for new active sound entity // by falling through to think_fast... From 237c63da301e7771ecfcf52c6ca6e3c8bd1a0d66 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 7 Aug 2022 16:43:29 +0300 Subject: [PATCH 6/7] Disable barnacle fix and set corpsephysics to 0 by default (#307) --- CMakeLists.txt | 2 +- dlls/game.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dddaef86..33b58846 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ else() option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) endif() -option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" ON) +option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" OFF) option(CLIENT_WEAPONS "Enable client local weapons prediction" ON) option(CROWBAR_IDLE_ANIM "Enable crowbar idle animation" ON) option(CROWBAR_DELAY_FIX "Enable crowbar attack delay fix" ON) diff --git a/dlls/game.cpp b/dlls/game.cpp index 5f0c5176..018d370c 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -37,7 +37,7 @@ cvar_t chargerfix = { "chargerfix", "1", FCVAR_SERVER }; cvar_t satchelfix = { "satchelfix", "1", FCVAR_SERVER }; cvar_t explosionfix = { "explosionfix", "1", FCVAR_SERVER }; cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER }; -cvar_t corpsephysics = { "corpsephysics", "1", FCVAR_SERVER }; +cvar_t corpsephysics = { "corpsephysics", "0", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; From bee6aa02c4ac41b32e5479702b2cc57f22873b26 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 8 Nov 2023 14:54:06 +0300 Subject: [PATCH 7/7] Improve friendly fire check for barney (#405) --- dlls/barney.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/barney.cpp b/dlls/barney.cpp index d610078a..8867d5cf 100644 --- a/dlls/barney.cpp +++ b/dlls/barney.cpp @@ -829,6 +829,7 @@ BOOL CBarney::NoFriendlyFire() CPlane backPlane; CPlane leftPlane; CPlane rightPlane; + CPlane frontPlane; Vector vecLeftSide; Vector vecRightSide; @@ -841,9 +842,13 @@ BOOL CBarney::NoFriendlyFire() v_left = gpGlobals->v_right * -1.0f; + CBaseEntity* pEnemy = m_hEnemy; + const Vector enemyCenter = pEnemy->Center(); + leftPlane.InitializePlane( gpGlobals->v_right, vecLeftSide ); rightPlane.InitializePlane( v_left, vecRightSide ); backPlane.InitializePlane( gpGlobals->v_forward, pev->origin ); + frontPlane.InitializePlane( gpGlobals->v_forward * -1, enemyCenter + gpGlobals->v_forward * pEnemy->pev->size.Length2D() / 2 ); for( int k = 1; k <= gpGlobals->maxClients; k++ ) { @@ -856,7 +861,10 @@ BOOL CBarney::NoFriendlyFire() { //ALERT(at_aiconsole, "%s: Ally player at fire plane!\n", STRING(pev->classname)); // player is in the check volume! Don't shoot! - return FALSE; + if (frontPlane.PointInFront( pPlayer->pev->origin )) + return FALSE; + else if (pEnemy->pev->deadflag == DEAD_DYING || pEnemy->pev->deadflag == DEAD_DEAD) // don't shoot when ally is behind the dying enemy + return FALSE; } } }