Merge pull request #5 from olegtsvetkov/fileexists-case-sensitive
Don't use Valve file system when calling a FileExists.
This commit is contained in:
		@@ -75,7 +75,7 @@ DownloadsLoad()
 | 
			
		||||
        GetArrayString(arrayDownloads, x, downloadpath, sizeof(downloadpath));
 | 
			
		||||
 | 
			
		||||
        // If file doesn't exist, then remove, log, and stop.
 | 
			
		||||
        if (!FileExists(downloadpath, true))
 | 
			
		||||
        if (!FileExists(downloadpath, false))
 | 
			
		||||
        {
 | 
			
		||||
            // Remove client from array.
 | 
			
		||||
            RemoveFromArray(arrayDownloads, x);
 | 
			
		||||
 
 | 
			
		||||
@@ -125,7 +125,7 @@ ModelsLoad()
 | 
			
		||||
        strcopy(buffer, sizeof(buffer), path);
 | 
			
		||||
        StrCat(buffer, sizeof(buffer), name);
 | 
			
		||||
        StrCat(buffer, sizeof(buffer), ".mdl");
 | 
			
		||||
        if (!FileExists(buffer, true))
 | 
			
		||||
        if (!FileExists(buffer, false))
 | 
			
		||||
        {
 | 
			
		||||
            LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Models, "Config Validation", "Warning: Invalid model name/path setting at index %d. File not found: \"%s\".", ModelCount + failedCount, buffer);
 | 
			
		||||
            failedCount++;
 | 
			
		||||
 
 | 
			
		||||
@@ -202,7 +202,7 @@ stock ClassValidateAttributes(classindex, bool:logErrors = false)
 | 
			
		||||
            !StrEqual(model_path, "no_change", false))
 | 
			
		||||
        {
 | 
			
		||||
            // Check if the file exists.
 | 
			
		||||
            if (!FileExists(model_path, true))
 | 
			
		||||
            if (!FileExists(model_path, false))
 | 
			
		||||
            {
 | 
			
		||||
                flags += ZR_CLASS_MODEL_PATH;
 | 
			
		||||
                if (logErrors)
 | 
			
		||||
@@ -264,7 +264,7 @@ stock ClassValidateAttributes(classindex, bool:logErrors = false)
 | 
			
		||||
    {
 | 
			
		||||
        // Check if the file exists.
 | 
			
		||||
        Format(overlay, sizeof(overlay), "materials/%s.vmt", overlay_path);
 | 
			
		||||
        if (!FileExists(overlay, true))
 | 
			
		||||
        if (!FileExists(overlay, false))
 | 
			
		||||
        {
 | 
			
		||||
            flags += ZR_CLASS_OVERLAY_PATH;
 | 
			
		||||
            if (logErrors)
 | 
			
		||||
@@ -503,7 +503,7 @@ stock ClassValidateEditableAttributes(attributes[ClassEditableAttributes])
 | 
			
		||||
        {
 | 
			
		||||
            // Check if the file exists.
 | 
			
		||||
            Format(overlay, sizeof(overlay), "materials/%s.vmt", overlay_path);
 | 
			
		||||
            if (!FileExists(overlay, true))
 | 
			
		||||
            if (!FileExists(overlay, false))
 | 
			
		||||
            {
 | 
			
		||||
                flags += ZR_CLASS_OVERLAY_PATH;
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -79,7 +79,7 @@ bool:AmbientSoundsValidateConfig()
 | 
			
		||||
    Format(sound, sizeof(sound), "sound/%s", sound);
 | 
			
		||||
 | 
			
		||||
    // If file doesn't exist, then log error and stop.
 | 
			
		||||
    if (!FileExists(sound, true))
 | 
			
		||||
    if (!FileExists(sound, false))
 | 
			
		||||
    {
 | 
			
		||||
        // Log invalid sound file error.
 | 
			
		||||
        LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_SEffects, "Config Validation", "Invalid sound file specified in \"zr_ambientsounds_file\": %s", sound);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user