]> git.xonotic.org Git - xonotic/darkplaces.git/commit
fs: recognise mods by -game cmdline args, deduplicate gamedirs, refactoring
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 28 Apr 2024 03:03:12 +0000 (13:03 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 2 May 2024 21:00:50 +0000 (07:00 +1000)
commit205931f2f5b7333523ca4f6c3cae7974a8f516c8
tree55471963bde7991b10bc6548a13e075dac200ecf
parenta7f7a172b5822c21ac9c7c1805d3d24a427761f4
fs: recognise mods by -game cmdline args, deduplicate gamedirs, refactoring

Players often start mods using -game even when they have their own
cmdline option, and modders often provide scripts which use -game.

This was already implemented but only for the `gamedir` command.
Refactoring was required to avoid chicken vs egg problems when doing it
with cmdline gamedirs too.

Fixes a bug: the first gamedir (in the cmdline or `gamedir` args) was
used to identify the mod but it needs to be the last one that matches
because the last gamedir is the primary (first in the search path, and
where files are saved).

Includes supported game and mod directories in the main gamedir list for
interface consistency, less special cases, and to support deduplication.
Refactoring was required in the menu modlist where there was also an
opportunity to simplify.

Fixes inability to change from a supported mod (eg rogue) back to id1.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cl_parse.c
com_game.c
com_game.h
fs.c
fs.h
menu.c