mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2025-02-12 14:55:58 +00:00
Added "maplist" command
This commit is contained in:
parent
b553fcf7e7
commit
a8d9ff049c
2 changed files with 29 additions and 0 deletions
|
@ -132,6 +132,7 @@ cvar_t *cl_talksound;
|
|||
|
||||
extern cvar_t *sys_nostdout;
|
||||
|
||||
extern void COM_Maplist_f (void);
|
||||
cvar_t *localid;
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
|
@ -1636,6 +1637,7 @@ void CL_Init (void)
|
|||
//
|
||||
// register our commands
|
||||
//
|
||||
Cmd_AddCommand ("maplist", COM_Maplist_f);
|
||||
Cmd_AddCommand ("changing", CL_Changing_f);
|
||||
#ifdef UQUAKE
|
||||
Cmd_AddCommand ("entities", CL_PrintEntities_f);
|
||||
|
|
|
@ -192,6 +192,33 @@ void COM_Path_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
void COM_Maplist_f (void)
|
||||
{
|
||||
searchpath_t *search;
|
||||
DIR *dir_ptr;
|
||||
struct dirent *dirent;
|
||||
char buf[MAX_OSPATH];
|
||||
|
||||
for (search = com_searchpaths ; search ; search = search->next)
|
||||
{
|
||||
if (!Q_strcmp (search->filename, ""))
|
||||
continue;
|
||||
snprintf (buf, sizeof(buf), "%s/maps", search->filename);
|
||||
dir_ptr = opendir(buf);
|
||||
Con_Printf ("Looking in %s...\n",buf);
|
||||
if (!dir_ptr)
|
||||
continue;
|
||||
while ((dirent = readdir (dir_ptr)))
|
||||
{
|
||||
if (!fnmatch ("*.bsp", dirent->d_name, 0))
|
||||
{
|
||||
Con_Printf ("%s\n", dirent->d_name);
|
||||
}
|
||||
}
|
||||
closedir (dir_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
COM_WriteFile
|
||||
|
|
Loading…
Reference in a new issue