mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-26 13:47:56 +03:00
New response context-based check for TLK_SPOTTED_HEADCRAB_LEAVING_ZOMBIE (because some death types, such as serverside ragdolling, remove the zombie instantly)
This commit is contained in:
parent
3ce8a35567
commit
e1c890a011
@ -2544,6 +2544,9 @@ void CNPC_BaseZombie::ReleaseHeadcrab( const Vector &vecOrigin, const Vector &ve
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
// Inherit some misc. properties
|
// Inherit some misc. properties
|
||||||
pGib->m_iViewHideFlags = m_iViewHideFlags;
|
pGib->m_iViewHideFlags = m_iViewHideFlags;
|
||||||
|
|
||||||
|
// Add response context for companion response (more reliable than checking for post-death zombie entity)
|
||||||
|
pCrab->AddContext( "from_zombie", "1", 2.0f );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pGib->SetOwnerEntity( this );
|
pGib->SetOwnerEntity( this );
|
||||||
|
@ -659,13 +659,18 @@ void CNPC_PlayerCompanion::DoCustomSpeechAI( void )
|
|||||||
{
|
{
|
||||||
SpeakIfAllowed( "TLK_SPOTTED_INCOMING_HEADCRAB" );
|
SpeakIfAllowed( "TLK_SPOTTED_INCOMING_HEADCRAB" );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// If we see a headcrab leaving a zombie that just died, mention it
|
// If we see a headcrab leaving a zombie that just died, mention it
|
||||||
else if ( pHC->GetOwnerEntity() && ( pHC->GetOwnerEntity()->Classify() == CLASS_ZOMBIE ) && !pHC->GetOwnerEntity()->IsAlive() )
|
// (Note that this is now a response context since some death types remove the zombie instantly)
|
||||||
|
int nContext = pHC->FindContextByName( "from_zombie" );
|
||||||
|
if ( nContext > -1 && !ContextExpired( nContext ) ) // pHC->GetOwnerEntity() && ( pHC->GetOwnerEntity()->Classify() == CLASS_ZOMBIE ) && !pHC->GetOwnerEntity()->IsAlive()
|
||||||
{
|
{
|
||||||
SpeakIfAllowed( "TLK_SPOTTED_HEADCRAB_LEAVING_ZOMBIE" );
|
SpeakIfAllowed( "TLK_SPOTTED_HEADCRAB_LEAVING_ZOMBIE" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if ( nClass == CLASS_ZOMBIE )
|
else if ( nClass == CLASS_ZOMBIE )
|
||||||
{
|
{
|
||||||
CNPC_BaseZombie *pZombie = dynamic_cast<CNPC_BaseZombie*>(GetEnemy());
|
CNPC_BaseZombie *pZombie = dynamic_cast<CNPC_BaseZombie*>(GetEnemy());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user