callofduty4x / CoD4x_Server

Extended Call of Duty 4 server
https://cod4x.ovh
GNU Affero General Public License v3.0
335 stars 121 forks source link

Find game files (main, zone) from current working directory rather than where the binary is #419

Open PureTryOut opened 1 year ago

PureTryOut commented 1 year ago

I'm trying to optimize my server setup and part of this is moving the game executable (cod4x18_dedrun) to a common bin directory with other executables. I have this directory added to my $PATH so I can execute it from everywhere but CoD4x (well, vanilla CoD4 as well) seems to search for the other game files in the directory where the executable is rather than the current working directory.

So say the executable is ~/.local/bin/cod4x18_dedrun and the current working directory is ~/game_server and has the main and zone folders, it currently looks for ~/.local/bin/main and ~/.local/bin/zone rather than ~/game_server/main and ~/game_server/zone.

It would be great if it could look for the files it needs in the current working directory, or maybe even change the location using an environment variable.

bbashy commented 7 months ago

+set homepath and +set basepath?