From 6c1db1f4f6f38fafacee1db06c2df57b1803a500 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Fri, 15 Dec 2023 17:00:13 -0800 Subject: [PATCH] Shared: add `bool FileExists(string filePath)` function --- src/shared/defs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/shared/defs.h b/src/shared/defs.h index 16e697f7..1a47a975 100644 --- a/src/shared/defs.h +++ b/src/shared/defs.h @@ -503,4 +503,14 @@ Route_GetJumpVelocity(vector vecFrom, vector vecTo, float flGravMod) vecJump[2] = 280; #endif return vecJump; +} + +bool +FileExists(string filePath) +{ + if (filePath != "") /* not empty */ + if not(whichpack(filePath)) /* not present on disk */ + return false; + + return true; } \ No newline at end of file