| 1895 | } |
| 1896 | |
| 1897 | void 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 | |
| 1922 | void CResponseSystem::LoadFromBuffer( const char *scriptfile, const char *buffer, CStringPool &includedFiles ) |
| 1923 | { |
nothing calls this directly
no test coverage detected