Skip to content

Commit

Permalink
Update apache
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikk155 committed Mar 15, 2024
1 parent b2c229e commit 9ea7c7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/game/server/entities/NPCs/military/apache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ void CApache::DyingThink()

if (/*(pev->spawnflags & SF_NOWRECKAGE) == 0 && */ (pev->flags & FL_ONGROUND) != 0)
{
CBaseEntity* pWreckage = Create("cycler_wreckage", pev->origin, pev->angles);
CBaseEntity* pWreckage = Create("cycler_wreckage", pev->origin, pev->angles, nullptr, false );
UTIL_InitializeKeyValues( pWreckage, m_InheritKey, m_InheritValue, m_InheritKeyValues );
DispatchSpawn( pWreckage->edict() );
// pWreckage->SetModel(STRING(pev->model));
pWreckage->SetSize(Vector(-200, -200, -128), Vector(200, 200, -32));
pWreckage->pev->frame = pev->frame;
Expand Down Expand Up @@ -719,7 +721,10 @@ void CApache::FireRocket()
break;
}

CBaseEntity* pRocket = CBaseEntity::Create("hvr_rocket", vecSrc, pev->angles, this);
CBaseEntity* pRocket = CBaseEntity::Create("hvr_rocket", vecSrc, pev->angles, this, false );
UTIL_InitializeKeyValues( pRocket, m_InheritKey, m_InheritValue, m_InheritKeyValues );
DispatchSpawn( pRocket->edict() );

if (pRocket)
{
MESSAGE_BEGIN(MSG_PVS, SVC_TEMPENTITY, vecSrc);
Expand Down Expand Up @@ -909,6 +914,13 @@ void CApache::TraceAttack(CBaseEntity* attacker, float flDamage, Vector vecDir,
}
}

bool CApache :: ShouldInheritKeyValue( const char* szKey )
{
return ( FStrEq( szKey, "model_replacement_filename" )
|| FStrEq( szKey, "sound_replacement_filename" )
);
}

class CApacheHVR : public CGrenade
{
DECLARE_CLASS(CApacheHVR, CGrenade);
Expand Down
2 changes: 2 additions & 0 deletions src/game/server/entities/NPCs/military/apache.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@ class CApache : public CBaseMonster

int m_iDoSmokePuff;
CBeam* m_pBeam;

bool ShouldInheritKeyValue( const char* szKey ) override;
};

0 comments on commit 9ea7c7c

Please sign in to comment.