forked from Mirrors/openclonk
Scenario list loader: Ignore .ocd and .ocg files when looking recursively for scenarios
parent
17153c6fbe
commit
0c50e81413
|
@ -164,6 +164,7 @@
|
|||
#define C4CFN_TempLeagueInfo "~league.tmp"
|
||||
|
||||
#define C4CFN_DefFiles "*.ocd"
|
||||
#define C4CFN_GenericGroupFiles "*.ocg"
|
||||
#define C4CFN_PlayerFiles "*.ocp"
|
||||
#define C4CFN_MaterialFiles "*.ocm"
|
||||
#define C4CFN_ObjectInfoFiles "*.oci"
|
||||
|
|
|
@ -524,6 +524,11 @@ bool C4ScenarioListLoader::Entry::Load(C4Group *pFromGrp, const StdStrBuf *psFil
|
|||
// helper func: Recursive check whether a directory contains a .ocs or .ocf file
|
||||
bool DirContainsScenarios(const char *szDir)
|
||||
{
|
||||
// Ignore object and group folders to avoid descending e.g. deep into unpacked Objects.ocd
|
||||
if (WildcardMatch(C4CFN_DefFiles, szDir) || WildcardMatch(C4CFN_GenericGroupFiles, szDir))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// create iterator on free store to avoid stack overflow with deeply recursed folders
|
||||
DirectoryIterator *pIter = new DirectoryIterator(szDir);
|
||||
const char *szChildFilename;
|
||||
|
|
Loading…
Reference in New Issue