diff options
Diffstat (limited to 'path-for-game-data.patch')
-rw-r--r-- | path-for-game-data.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/path-for-game-data.patch b/path-for-game-data.patch new file mode 100644 index 000000000000..5438cce3ffcc --- /dev/null +++ b/path-for-game-data.patch @@ -0,0 +1,26 @@ +--- simmain.cc.orig 2020-12-29 18:02:43.847017475 +0100 ++++ simmain.cc 2020-12-29 18:16:11.362277537 +0100 +@@ -425,6 +425,11 @@ + + env_t::init(); + ++ // Make simutrans extended re-symlinks the files when opened ++#ifdef __linux__ ++ system("\cp -rs --remove-destination /usr/share/games/simutrans-extended/ ~/.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-extended/", getenv("HOME")); ++ strcpy(env_t::data_dir, buffer); + + #ifdef __APPLE__ + // change working directory from binary dir to bundle dir |