From ee2b6ce55a3eb57002d43b89c5f6041c551b0bd9 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 1 Mar 2013 23:55:12 +0000 Subject: [PATCH] fixed fitzquake's map existence check in Host_Changelevel_f () leaking file handles which would end up in a Sys_Error () due to consuming all free handles if many maps reside not in pak files. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@825 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/host_cmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Quake/host_cmd.c b/Quake/host_cmd.c index 0acd33ac..94bce8ba 100644 --- a/Quake/host_cmd.c +++ b/Quake/host_cmd.c @@ -866,7 +866,6 @@ Goes to a new map, taking all clients along void Host_Changelevel_f (void) { char level[MAX_QPATH]; - int i; //johnfitz if (Cmd_Argc() != 2) { @@ -881,7 +880,7 @@ void Host_Changelevel_f (void) //johnfitz -- check for client having map before anything else q_snprintf (level, sizeof(level), "maps/%s.bsp", Cmd_Argv(1)); - if (COM_OpenFile (level, &i, NULL) == -1) + if (!COM_FileExists(level, NULL)) Host_Error ("cannot find map %s", level); //johnfitz