WIP: q3map2 allow to use ${XDG_DATA_HOME} in game .c files <3 Ingar
If homeBasePath
in game_t
starts with ${XDG_DATA_HOME}
it uses this absolute path as home dir, else it use the given path as a home subdirectory (like it was in any case until now).
Unvanquished starts to use it since now.
$ ./q3map2 -game unvanquished -fs_nomagicpath | grep 'VFS Init:'
VFS Init: /home/illwieckz/.local/share/unvanquished/pkg/
$ XDG_DATA_HOME=/media/illwieckz/external_drive ./q3map2 -game unvanquished -fs_nomagicpath | grep 'VFS Init:'
VFS Init: /media/illwieckz/external_drive/unvanquished/pkg/
I also cleaned-up the code a bit, no longer adding a useless /.
to remove it right after that (wat?).
Note: it only works with the ${XDG_DATA_HOME}
keyword, not with $XDG_DATA_HOME
. There is no need to support the later and it would overcomplicate things.
Edited by Thomas Debesse