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 ) 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 ) if ( fActive )
{ {
GetOuter()->SpeakSentence( STANDOFF_SENTENCE_BEGIN_STANDOFF ); GetOuter()->SpeakSentence( STANDOFF_SENTENCE_BEGIN_STANDOFF );
@ -251,6 +268,7 @@ void CAI_StandoffBehavior::SetActive( bool fActive )
m_fActive = fActive; m_fActive = fActive;
NotifyChangeBehaviorStatus(); NotifyChangeBehaviorStatus();
#endif
} }
} }

View File

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