Fixed metrocops not speaking standoff sentences correctly

This commit is contained in:
Blixibon 2021-09-18 18:31:29 -05:00
parent e27f4df8e5
commit 80251f67ec
2 changed files with 24 additions and 1 deletions

View File

@ -240,6 +240,23 @@ void CAI_StandoffBehavior::SetActive( bool fActive )
{
if ( fActive != m_fActive )
{
#ifdef MAPBASE
// These sentences are only spoken if the standoff behavior is active, so they have to be arranged separately
if ( fActive )
{
m_fActive = fActive;
NotifyChangeBehaviorStatus();
GetOuter()->SpeakSentence( STANDOFF_SENTENCE_BEGIN_STANDOFF );
}
else
{
GetOuter()->SpeakSentence( STANDOFF_SENTENCE_END_STANDOFF );
m_fActive = fActive;
NotifyChangeBehaviorStatus();
}
#else
if ( fActive )
{
GetOuter()->SpeakSentence( STANDOFF_SENTENCE_BEGIN_STANDOFF );
@ -251,6 +268,7 @@ void CAI_StandoffBehavior::SetActive( bool fActive )
m_fActive = fActive;
NotifyChangeBehaviorStatus();
#endif
}
}

View File

@ -882,7 +882,7 @@ void CNPC_MetroPolice::SpeakStandoffSentence( int nSentenceType )
break;
case STANDOFF_SENTENCE_FORCED_TAKE_COVER:
SpeakIfAllowed( TLK_COP_SO_END );
SpeakIfAllowed( TLK_COP_SO_FORCE_COVER );
break;
case STANDOFF_SENTENCE_STAND_CHECK_TARGET:
@ -1008,7 +1008,12 @@ void CNPC_MetroPolice::SpeakSentence( int nSentenceType )
return;
}
#ifdef MAPBASE
// Fixed issues with standoff sentences not playing when they should
if ( m_StandoffBehavior.IsActive() )
#else
if ( GetRunningBehavior() == &m_StandoffBehavior )
#endif
{
SpeakStandoffSentence( nSentenceType );
return;