From 32597276c2db1cf8bd4b86752c07d6e4df2f577d Mon Sep 17 00:00:00 2001 From: Bryce Hutchings Date: Tue, 18 Jun 2002 09:22:16 +0000 Subject: [PATCH] file exist function --- reaction/game/g_local.h | 4 ++++ reaction/game/g_misc.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index 3b8c08bf..aa0a2281 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.96 2002/06/18 09:22:16 niceass +// file exist function +// // Revision 1.95 2002/06/16 20:11:41 niceass // unused cvar removed // @@ -933,6 +936,7 @@ void G_EvaluateTrajectory(const trajectory_t * tr, int atTime, vec3_t result); void G_EvaluateTrajectoryDelta(const trajectory_t * tr, int atTime, vec3_t result); void G_GravityChange(void); void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t * ent); +qboolean G_FileExists(char *filename); // // g_weapon.c diff --git a/reaction/game/g_misc.c b/reaction/game/g_misc.c index a99ab34a..d983d01a 100644 --- a/reaction/game/g_misc.c +++ b/reaction/game/g_misc.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.58 2002/06/18 09:21:11 niceass +// file exist function +// // Revision 1.57 2002/06/16 20:06:14 jbravo // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // @@ -964,6 +967,22 @@ void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t * ent) tent->s.powerups = ent->mass; // speed of pressure } +/* + G_FileExists by NiceAss + + Created for vote map to make sure it exists before voting. + I'm sure there are plenty of more uses. +*/ +qboolean G_FileExists(char *filename) { + fileHandle_t f; + + trap_FS_FOpenFile(filename, &f, FS_READ); + if (!f) return qfalse; + trap_FS_FCloseFile(f); + return qtrue; +} + + /* ================ G_EvaluateTrajectory