From 3246a96aa85d19015a38e737fc2de015315cb140 Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 2 May 2019 07:10:07 +0000 Subject: [PATCH] Fix demolist/cmd dlist crash when there's no demos. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5454 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_mvd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/server/sv_mvd.c b/engine/server/sv_mvd.c index 78012d901..17fec52fa 100644 --- a/engine/server/sv_mvd.c +++ b/engine/server/sv_mvd.c @@ -2433,7 +2433,7 @@ void SV_MVDList_f (void) Con_Printf("content of %s/*.mvd\n", sv_demoDir.string); dir = Sys_listdemos(sv_demoDir.string, true, SORT_BY_DATE); list = dir->files; - if (!list->name[0]) + if (!dir->numfiles) { Con_Printf("no demos\n"); } @@ -2485,7 +2485,7 @@ void SV_UserCmdMVDList_f (void) SV_ClientPrintf(host_client, PRINT_HIGH, "available demos:\n"); dir = Sys_listdemos(sv_demoDir.string, true, SORT_BY_DATE); list = dir->files; - if (!list->name[0]) + if (!dir->numfiles) { SV_ClientPrintf(host_client, PRINT_HIGH, "no demos\n"); } @@ -2568,7 +2568,7 @@ void SV_UserCmdMVDList_HTML (vfsfile_t *pipe) VFS_PRINTF(pipe, "available demos:
\n"); dir = Sys_listdemos(sv_demoDir.string, true, SORT_BY_DATE); list = dir->files; - if (!list->name[0]) + if (!dir->numfiles) { VFS_PRINTF(pipe, "no demos
\n"); }