From 3c7a85fe9456b2bc31f3d29198bf2ec060e176f3 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 17 Jun 2007 15:48:57 +0000 Subject: (svn r10182) -Codechange: rewrite most part of the file loading/searching to be more flexible. -Codechange: add support for personal directories on Windows. -Fix [FS#153, FS#193, FS#502, FS#816, FS#854]: fix issues related to fixed names, fixed places of files/directories and application bundles. --- src/fios.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/fios.cpp') diff --git a/src/fios.cpp b/src/fios.cpp index cdde6e3cd..bec0475c2 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -14,6 +14,7 @@ #include "helpers.hpp" #include "table/strings.h" #include "fios.h" +#include "fileio.h" #include #include @@ -334,7 +335,7 @@ FiosItem *FiosGetSavegameList(int mode) if (_fios_save_path == NULL) { _fios_save_path = MallocT(MAX_PATH); - ttd_strlcpy(_fios_save_path, _paths.save_dir, MAX_PATH); + FioGetDirectory(_fios_save_path, MAX_PATH, SAVE_DIR); } _fios_path = _fios_save_path; @@ -380,9 +381,10 @@ FiosItem *FiosGetScenarioList(int mode) { static char *_fios_scn_path = NULL; + /* Copy the default path on first run or on 'New Game' */ if (_fios_scn_path == NULL) { _fios_scn_path = MallocT(MAX_PATH); - ttd_strlcpy(_fios_scn_path, _paths.scenario_dir, MAX_PATH); + FioGetDirectory(_fios_scn_path, MAX_PATH, SCENARIO_DIR); } _fios_path = _fios_scn_path; @@ -413,7 +415,7 @@ FiosItem *FiosGetHeightmapList(int mode) if (_fios_hmap_path == NULL) { _fios_hmap_path = MallocT(MAX_PATH); - strcpy(_fios_hmap_path, _paths.heightmap_dir); + FioGetDirectory(_fios_hmap_path, MAX_PATH, HEIGHTMAP_DIR); } _fios_path = _fios_hmap_path; -- cgit v1.2.3-70-g09d2