Added support for resource files in Valve's file system. Thanks to Kyle.

This commit is contained in:
Richard Helgeby 2013-04-16 02:43:29 +02:00
parent 5269107303
commit 7e72ede0ca
3 changed files with 5 additions and 5 deletions

View File

@ -75,7 +75,7 @@ DownloadsLoad()
GetArrayString(arrayDownloads, x, downloadpath, sizeof(downloadpath)); GetArrayString(arrayDownloads, x, downloadpath, sizeof(downloadpath));
// If file doesn't exist, then remove, log, and stop. // If file doesn't exist, then remove, log, and stop.
if (!FileExists(downloadpath)) if (!FileExists(downloadpath, true))
{ {
// Remove client from array. // Remove client from array.
RemoveFromArray(arrayDownloads, x); RemoveFromArray(arrayDownloads, x);

View File

@ -125,7 +125,7 @@ ModelsLoad()
strcopy(buffer, sizeof(buffer), path); strcopy(buffer, sizeof(buffer), path);
StrCat(buffer, sizeof(buffer), name); StrCat(buffer, sizeof(buffer), name);
StrCat(buffer, sizeof(buffer), ".mdl"); StrCat(buffer, sizeof(buffer), ".mdl");
if (!FileExists(buffer)) if (!FileExists(buffer, true))
{ {
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); 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++; failedCount++;

View File

@ -202,7 +202,7 @@ stock ClassValidateAttributes(classindex, bool:logErrors = false)
!StrEqual(model_path, "no_change", false)) !StrEqual(model_path, "no_change", false))
{ {
// Check if the file exists. // Check if the file exists.
if (!FileExists(model_path)) if (!FileExists(model_path, true))
{ {
flags += ZR_CLASS_MODEL_PATH; flags += ZR_CLASS_MODEL_PATH;
if (logErrors) if (logErrors)
@ -253,7 +253,7 @@ stock ClassValidateAttributes(classindex, bool:logErrors = false)
{ {
// Check if the file exists. // Check if the file exists.
Format(overlay, sizeof(overlay), "materials/%s.vmt", overlay_path); Format(overlay, sizeof(overlay), "materials/%s.vmt", overlay_path);
if (!FileExists(overlay)) if (!FileExists(overlay, true))
{ {
flags += ZR_CLASS_OVERLAY_PATH; flags += ZR_CLASS_OVERLAY_PATH;
if (logErrors) if (logErrors)
@ -485,7 +485,7 @@ stock ClassValidateEditableAttributes(attributes[ClassEditableAttributes])
{ {
// Check if the file exists. // Check if the file exists.
Format(overlay, sizeof(overlay), "materials/%s.vmt", overlay_path); Format(overlay, sizeof(overlay), "materials/%s.vmt", overlay_path);
if (!FileExists(overlay)) if (!FileExists(overlay, true))
{ {
flags += ZR_CLASS_OVERLAY_PATH; flags += ZR_CLASS_OVERLAY_PATH;
} }