diff options
author | Roboron3042 | 2021-01-26 22:23:31 +0100 |
---|---|---|
committer | Roboron3042 | 2021-01-26 22:23:31 +0100 |
commit | 48c6357c6317ffffae30ac56dccb8e9c5576eb18 (patch) | |
tree | 9cc3d7e1f4ec049d8a64784d03a414d35eaecc0c /path-for-game-data.patch | |
download | aur-48c6357c6317ffffae30ac56dccb8e9c5576eb18.tar.gz |
Initial commit
Diffstat (limited to 'path-for-game-data.patch')
-rw-r--r-- | path-for-game-data.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/path-for-game-data.patch b/path-for-game-data.patch new file mode 100644 index 000000000000..2c2ecdc236f2 --- /dev/null +++ b/path-for-game-data.patch @@ -0,0 +1,28 @@ +Index: simmain.cc +=================================================================== +--- simmain.cc (revisiĆ³n: 9320) ++++ simmain.cc (copia de trabajo) +@@ -428,6 +428,11 @@ + + env_t::init(); + ++ // Make simutrans re-symlinks the files when opened ++#ifdef __linux__ ++ system("\cp -rs --remove-destination /usr/share/games/simutrans/ ~/.local/share/"); ++#endif ++ + // you really want help with this? + if (gimme_arg(argc, argv, "-h", 0) || + gimme_arg(argc, argv, "-?", 0) || +@@ -515,8 +520,9 @@ + strcat( env_t::data_dir, PATH_SEPARATOR ); + } + else { +- strcpy( env_t::data_dir, argv[0] ); +- *(strrchr( env_t::data_dir, PATH_SEPARATOR[0] )+1) = 0; ++ static char buffer[100]; ++ sprintf(buffer, "%s/.local/share/simutrans/", getenv("HOME")); ++ strcpy(env_t::data_dir, buffer); + + #ifdef __APPLE__ + // change working directory from binary dir to bundle dir |