From db61fc170d61d61258856210198be33cbb06f160 Mon Sep 17 00:00:00 2001 From: MegaBrutal Date: Sun, 31 Dec 2023 02:15:00 +0100 Subject: [PATCH] Remove Unix platform dependency in fileExists() --- dllapi.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/dllapi.cpp b/dllapi.cpp index acc2906..75e920c 100644 --- a/dllapi.cpp +++ b/dllapi.cpp @@ -32,8 +32,6 @@ * */ -#include - #include #include @@ -67,10 +65,8 @@ typedef struct { precache_entry precache_list[MAX_PRECACHE_COUNT]; unsigned short int precache_count = 0; -bool fileExists(const char* path) { - char fullpath[256]; - snprintf(fullpath, sizeof(fullpath), "%s/%s", &gGamedir[0], path); - return access(fullpath, R_OK) == 0; +bool fileExists(char* path) { + return g_engfuncs.pfnGetFileSize(path) != -1; } bool addPrecacheEntry(const char* playername, const char* model) { -- 2.34.1