Browse Source

Merge branch 'opfor' into opforfixed

opforfixed
Andrey Akhmichin 1 year ago
parent
commit
d13dec76f2
  1. 31
      dlls/gearbox/fgrunt.cpp
  2. 2
      dlls/osprey.h

31
dlls/gearbox/fgrunt.cpp

@ -1364,7 +1364,7 @@ int CHFGrunt :: ISoundMask ( void)
//========================================================= //=========================================================
void CHFGrunt :: CheckAmmo ( void ) void CHFGrunt :: CheckAmmo ( void )
{ {
if ( m_cAmmoLoaded <= 0 ) if ( pev->weapons != 0 && m_cAmmoLoaded <= 0 )
{ {
SetConditions(bits_COND_NO_AMMO_LOADED); SetConditions(bits_COND_NO_AMMO_LOADED);
} }
@ -1533,7 +1533,7 @@ BOOL CHFGrunt :: CheckMeleeAttack1 ( float flDot, float flDist )
//========================================================= //=========================================================
BOOL CHFGrunt :: CheckRangeAttack1 ( float flDot, float flDist ) BOOL CHFGrunt :: CheckRangeAttack1 ( float flDot, float flDist )
{ {
if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() && ( GetBodygroup( 3 ) != 3 ) ) if ( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() && GetBodygroup( FG_GUN_GROUP ) != FG_GUN_NONE )
{ {
TraceResult tr; TraceResult tr;
@ -1546,7 +1546,7 @@ BOOL CHFGrunt :: CheckRangeAttack1 ( float flDot, float flDist )
Vector vecSrc = GetGunPosition(); Vector vecSrc = GetGunPosition();
// verify that a bullet fired from the gun will hit the enemy before the world. // verify that a bullet fired from the gun will hit the enemy before the world.
UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget(vecSrc), ignore_monsters, ignore_glass, ENT(pev), &tr); UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget(vecSrc), ignore_monsters, ENT(pev), &tr);
if ( tr.flFraction == 1.0 ) if ( tr.flFraction == 1.0 )
{ {
@ -1994,33 +1994,38 @@ void CHFGrunt :: Spawn()
{ {
m_iHead = RANDOM_LONG(FG_HEAD_SAW, FG_HEAD_SAW_BLACK); m_iHead = RANDOM_LONG(FG_HEAD_SAW, FG_HEAD_SAW_BLACK);
} }
else if (pev->weapons == 0)
{
m_iHead = FG_HEAD_MP;
}
else else
m_iHead = FG_HEAD_MASK; m_iHead = FG_HEAD_MASK;
} }
else if ( m_iHead >= FG_HEAD_COUNT ) else if ( m_iHead >= FG_HEAD_COUNT )
m_iHead = FG_HEAD_MASK; m_iHead = FG_HEAD_MASK;
if ( pev->weapons <= 0 ) if (FBitSet( pev->weapons, FGRUNT_9MMAR ))
{ {
pev->weapons = FGRUNT_9MMAR; SetBodygroup( FG_GUN_GROUP, FG_GUN_MP5 );
m_cClipSize = FGRUNT_CLIP_SIZE;
} }
if (FBitSet( pev->weapons, FGRUNT_SHOTGUN )) else if (FBitSet( pev->weapons, FGRUNT_SHOTGUN ))
{ {
SetBodygroup( FG_GUN_GROUP, FG_GUN_SHOTGUN ); SetBodygroup( FG_GUN_GROUP, FG_GUN_SHOTGUN );
SetBodygroup( FG_TORSO_GROUP, FG_TORSO_SHOTGUN ); SetBodygroup( FG_TORSO_GROUP, FG_TORSO_SHOTGUN );
m_cClipSize = 8; m_cClipSize = 8;
} }
if (FBitSet( pev->weapons, FGRUNT_9MMAR )) else if (FBitSet( pev->weapons, FGRUNT_M249 ))
{
SetBodygroup( FG_GUN_GROUP, FG_GUN_MP5 );
m_cClipSize = FGRUNT_CLIP_SIZE;
}
if (FBitSet( pev->weapons, FGRUNT_M249 ))
{ {
SetBodygroup( FG_GUN_GROUP, FG_GUN_SAW ); SetBodygroup( FG_GUN_GROUP, FG_GUN_SAW );
SetBodygroup( FG_TORSO_GROUP, FG_TORSO_M249 ); SetBodygroup( FG_TORSO_GROUP, FG_TORSO_M249 );
m_cClipSize = FGRUNT_CLIP_SIZE; m_cClipSize = FGRUNT_CLIP_SIZE;
} }
else
{
SetBodygroup( FG_GUN_GROUP, FG_GUN_NONE );
m_cClipSize = 0;
}
SetBodygroup( FG_HEAD_GROUP, m_iHead ); SetBodygroup( FG_HEAD_GROUP, m_iHead );
@ -2375,7 +2380,7 @@ Schedule_t* CHFGrunt :: GetScheduleOfType ( int Type )
break; break;
case SCHED_HGRUNT_ALLY_ELOF_FAIL: case SCHED_HGRUNT_ALLY_ELOF_FAIL:
{ {
return GetScheduleOfType( SCHED_RANGE_ATTACK1 ); return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ENEMY );
} }
break; break;
case SCHED_HGRUNT_ALLY_ESTABLISH_LINE_OF_FIRE: case SCHED_HGRUNT_ALLY_ESTABLISH_LINE_OF_FIRE:

2
dlls/osprey.h

@ -38,7 +38,7 @@ public:
void EXPORT DeployThink(void); void EXPORT DeployThink(void);
void Flight(void); void Flight(void);
void EXPORT HitTouch(CBaseEntity *pOther); void EXPORT HitTouch(CBaseEntity *pOther);
virtual void EXPORT FindAllThink(void); void EXPORT FindAllThink(void);
void EXPORT HoverThink(void); void EXPORT HoverThink(void);
virtual CBaseMonster *MakeGrunt(Vector vecSrc); virtual CBaseMonster *MakeGrunt(Vector vecSrc);
void EXPORT CrashTouch(CBaseEntity *pOther); void EXPORT CrashTouch(CBaseEntity *pOther);

Loading…
Cancel
Save