Esempio n. 1
0
	bool CommandResponseQueue::WaitForResponse(CommandResponse& arRsp, int aSeq, millis_t aTimeout)
	{
		CriticalSection cs(&mLock);
	
		//first try to fun the response, maybe it already got put in before we waited
		if(FindResponse(aSeq, arRsp)) return true;
		
		if(aTimeout < 0) cs.Wait();
		else cs.TimedWait(aTimeout);

		return FindResponse(aSeq, arRsp);
	}
//-----------------------------------------------------------------------------
// Purpose: Fill out given response with the appropriate one for this concept
//-----------------------------------------------------------------------------
void CBaseMultiplayerPlayer::SpeakConcept( AI_Response &outResponse, int iConcept )
{
	m_iCurrentConcept = iConcept;
	AIConcept_t concept( g_pszMPConcepts[iConcept] );
	FindResponse( outResponse, concept );
}