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

Method ParseInclude

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

Source from the content-addressed store, hash-verified

1895}
1896
1897void CResponseSystem::ParseInclude( CStringPool &includedFiles )
1898{
1899 char includefile[ 256 ];
1900 ParseToken();
1901 Q_snprintf( includefile, sizeof( includefile ), "scripts/%s", token );
1902
1903 // check if the file is already included
1904 if ( includedFiles.Find( includefile ) != NULL )
1905 {
1906 return;
1907 }
1908
1909 MEM_ALLOC_CREDIT();
1910
1911 // Try and load it
1912 CUtlBuffer buf;
1913 if ( !filesystem->ReadFile( includefile, "GAME", buf ) )
1914 {
1915 DevMsg( "Unable to load #included script %s\n", includefile );
1916 return;
1917 }
1918
1919 LoadFromBuffer( includefile, (const char *)buf.PeekGet(), includedFiles );
1920}
1921
1922void CResponseSystem::LoadFromBuffer( const char *scriptfile, const char *buffer, CStringPool &includedFiles )
1923{

Callers

nothing calls this directly

Calls 5

ParseTokenFunction · 0.70
DevMsgFunction · 0.70
FindMethod · 0.45
ReadFileMethod · 0.45
PeekGetMethod · 0.45

Tested by

no test coverage detected