Skip to content

Commit

Permalink
Fix completing map names from subdirs.
Browse files Browse the repository at this point in the history
Not a proper fix but whatever.
  • Loading branch information
skullernet authored and res2k committed Jan 3, 2025
1 parent aba2204 commit eb1b4e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,13 @@ static void SV_Map_f(void)

static void SV_Map_c(genctx_t *ctx, int argnum)
{
unsigned flags = FS_SEARCH_SAVEPATH | FS_SEARCH_BYFILTER | FS_SEARCH_STRIPEXT;
if (argnum == 1) {
FS_File_g("maps", ".bsp", FS_SEARCH_STRIPEXT, ctx);
FS_File_g("maps", "*.bsp", flags, ctx);
const char *s = Cvar_VariableString("map_override_path");
if (*s) {
int pos = ctx->count;
FS_File_g(s, ".bsp.override", FS_SEARCH_STRIPEXT, ctx);
FS_File_g(s, "*.bsp.override", flags, ctx);
for (int i = pos; i < ctx->count; i++)
*COM_FileExtension(ctx->matches[i]) = 0;
}
Expand Down

0 comments on commit eb1b4e6

Please sign in to comment.