MCPcopy Create free account
hub / github.com/BSVino/DoubleAction / ParseResponse

Method ParseResponse

mp/src/game/server/AI_ResponseSystem.cpp:2189–2328  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Purpose: Input : *kv - -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2187// Input : *kv -
2188//-----------------------------------------------------------------------------
2189void CResponseSystem::ParseResponse( void )
2190{
2191 // Should have groupname at start
2192 char responseGroupName[ 128 ];
2193
2194 ResponseGroup newGroup;
2195 AI_ResponseParams *rp = &newGroup.rp;
2196
2197 // Response Group Name
2198 ParseToken();
2199 Q_strncpy( responseGroupName, token, sizeof( responseGroupName ) );
2200
2201 while ( 1 )
2202 {
2203 ParseToken();
2204
2205 // Oops, part of next definition
2206 if( IsRootCommand() )
2207 {
2208 Unget();
2209 break;
2210 }
2211
2212 if ( !Q_stricmp( token, "{" ) )
2213 {
2214 while ( 1 )
2215 {
2216 ParseToken();
2217 if ( !Q_stricmp( token, "}" ) )
2218 break;
2219
2220 if ( !Q_stricmp( token, "permitrepeats" ) )
2221 {
2222 newGroup.m_bDepleteBeforeRepeat = false;
2223 continue;
2224 }
2225 else if ( !Q_stricmp( token, "sequential" ) )
2226 {
2227 newGroup.SetSequential( true );
2228 continue;
2229 }
2230 else if ( !Q_stricmp( token, "norepeat" ) )
2231 {
2232 newGroup.SetNoRepeat( true );
2233 continue;
2234 }
2235
2236 ParseOneResponse( responseGroupName, newGroup );
2237 }
2238 break;
2239 }
2240
2241 if ( !Q_stricmp( token, "predelay" ) )
2242 {
2243 ParseToken();
2244 rp->flags |= AI_ResponseParams::RG_DELAYBEFORESPEAK;
2245 rp->predelay.FromInterval( ReadInterval( token ) );
2246 continue;

Callers

nothing calls this directly

Calls 9

ReadIntervalFunction · 0.85
clampFunction · 0.85
TextToSoundLevelFunction · 0.85
SetSequentialMethod · 0.80
SetNoRepeatMethod · 0.80
ParseTokenFunction · 0.70
UngetFunction · 0.70
FromIntervalMethod · 0.45
InsertMethod · 0.45

Tested by

no test coverage detected