mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-27 06:07:56 +03:00
Added misc. speech/choreo utilities to ai_speech_new
This commit is contained in:
parent
ef19f1455d
commit
ed21bb3d1d
@ -1528,6 +1528,32 @@ void CAI_Expresser::ClearSpokeConcept( const AIConcept_t &concept )
|
||||
m_ConceptHistories.Remove( concept );
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
//-------------------------------------
|
||||
|
||||
AIConcept_t CAI_Expresser::GetLastSpokeConcept( AIConcept_t excludeConcept /* = NULL */ )
|
||||
{
|
||||
int iLastSpokenIndex = m_ConceptHistories.InvalidIndex();
|
||||
float flLast = 0.0f;
|
||||
for ( int i = m_ConceptHistories.First(); i != m_ConceptHistories.InvalidIndex(); i = m_ConceptHistories.Next(i ) )
|
||||
{
|
||||
ConceptHistory_t *h = &m_ConceptHistories[ i ];
|
||||
|
||||
// If an 'exclude concept' was provided, skip over this entry in the history if it matches the exclude concept
|
||||
if ( excludeConcept != NULL && FStrEq( m_ConceptHistories.GetElementName( i ), excludeConcept ) )
|
||||
continue;
|
||||
|
||||
if ( h->timeSpoken >= flLast )
|
||||
{
|
||||
iLastSpokenIndex = i;
|
||||
flLast = h->timeSpoken;
|
||||
}
|
||||
}
|
||||
|
||||
return iLastSpokenIndex != m_ConceptHistories.InvalidIndex() ? m_ConceptHistories.GetElementName( iLastSpokenIndex ) : NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-------------------------------------
|
||||
|
||||
void CAI_Expresser::DumpHistories()
|
||||
|
@ -211,6 +211,10 @@ public:
|
||||
float GetTimeSpokeConcept( const AIConcept_t &concept ); // returns -1 if never
|
||||
void SetSpokeConcept( const AIConcept_t &concept, AI_Response *response, bool bCallback = true );
|
||||
void ClearSpokeConcept( const AIConcept_t &concept );
|
||||
|
||||
#ifdef MAPBASE
|
||||
AIConcept_t GetLastSpokeConcept( AIConcept_t excludeConcept = NULL );
|
||||
#endif
|
||||
|
||||
// --------------------------------
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user