Test for a hardcoded relative datadir path.
When the path is hardcoded it should also test for relative paths. Based on a patch by crimson_penguin.
This commit is contained in:
parent
f3aca6d9ad
commit
f30fde6150
1 changed files with 6 additions and 0 deletions
|
@ -256,6 +256,12 @@ game_controller::game_controller(int argc, char** argv) :
|
|||
{
|
||||
bool no_music = false;
|
||||
bool no_sound = false;
|
||||
|
||||
// The path can be hardcoded and it might be a relative path.
|
||||
if(!game_config::path.empty() && game_config::path[0] != '/') {
|
||||
game_config::path = get_cwd() + '/' + game_config::path;
|
||||
}
|
||||
|
||||
for(arg_ = 1; arg_ != argc_; ++arg_) {
|
||||
const std::string val(argv_[arg_]);
|
||||
if(val.empty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue