From: MegaBrutal Date: Sun, 31 Dec 2023 01:15:00 +0000 (+0100) Subject: Remove Unix platform dependency in fileExists() X-Git-Url: http://git.megabrutal.com/?p=pmprecache.git;a=commitdiff_plain;h=db61fc170d61d61258856210198be33cbb06f160 Remove Unix platform dependency in fileExists() --- 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) {