MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / FindFile

Method FindFile

neo/framework/FileSystem.cpp:3823–3844  ·  view source on GitHub ↗

=============== idFileSystemLocal::FindFile =============== */

Source from the content-addressed store, hash-verified

3821===============
3822*/
3823 findFile_t idFileSystemLocal::FindFile( const char *path, bool scheduleAddons ) {
3824 pack_t *pak;
3825 idFile *f = OpenFileReadFlags( path, FSFLAG_SEARCH_DIRS | FSFLAG_SEARCH_PAKS | FSFLAG_SEARCH_ADDONS, &pak );
3826 if ( !f ) {
3827 return FIND_NO;
3828 }
3829 if ( !pak ) {
3830 // found in FS, not even in paks
3831 return FIND_YES;
3832 }
3833 // marking addons for inclusion on reload - may need to do that even when already in the search path
3834 if ( scheduleAddons && pak->addon && addonChecksums.FindIndex( pak->checksum ) < 0 ) {
3835 addonChecksums.Append( pak->checksum );
3836 }
3837 // an addon that's not on search list yet? that will require a restart
3838 if ( pak->addon && !pak->addon_search ) {
3839 delete f;
3840 return FIND_ADDON;
3841 }
3842 delete f;
3843 return FIND_YES;
3844}
3845
3846/*
3847===============

Callers 4

InitInstanceMethod · 0.80
Session_Map_fFunction · 0.80
Session_DevMap_fFunction · 0.80
ExecuteMapChangeMethod · 0.80

Calls 2

FindIndexMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected