1
0
Fork 0

(svn r5857) - Backport from trunk (r5800):

When directories were changed in 'Play Scenario', pressing 'New Game' showed
  scenarios from that directory, not the default one.
release/0.4
Darkvater 2006-08-12 12:11:54 +00:00
parent a597fd50e6
commit f2e4b69d5c
3 changed files with 12 additions and 9 deletions

7
os2.c
View File

@ -210,9 +210,10 @@ FiosItem *FiosGetScenarioList(int *num, int mode)
int sort_start;
char filename[MAX_PATH];
if (_fios_scn_path == NULL) {
_fios_scn_path = malloc(MAX_PATH);
strcpy(_fios_scn_path, _path.scenario_dir);
/* Copy the default path on first run or on 'New Game' */
if (mode == SLD_NEW_GAME || _fios_scn_path == NULL) {
if (_fios_scn_path == NULL) _fios_scn_path = malloc(MAX_PATH);
ttd_strlcpy(_fios_scn_path, _path.scenario_dir, MAX_PATH);
}
_fios_path = _fios_scn_path;

7
unix.c
View File

@ -208,9 +208,10 @@ FiosItem *FiosGetScenarioList(int *num, int mode)
int sort_start;
char filename[MAX_PATH];
if (_fios_scn_path == NULL) {
_fios_scn_path = malloc(MAX_PATH);
strcpy(_fios_scn_path, _path.scenario_dir);
/* Copy the default path on first run or on 'New Game' */
if (mode == SLD_NEW_GAME || _fios_scn_path == NULL) {
if (_fios_scn_path == NULL) _fios_scn_path = malloc(MAX_PATH);
ttd_strlcpy(_fios_scn_path, _path.scenario_dir, MAX_PATH);
}
_fios_path = _fios_scn_path;

View File

@ -779,9 +779,10 @@ FiosItem *FiosGetScenarioList(int *num, int mode)
HANDLE h;
int sort_start;
if (_fios_scn_path == NULL) {
_fios_scn_path = malloc(MAX_PATH);
strcpy(_fios_scn_path, _path.scenario_dir);
/* Copy the default path on first run or on 'New Game' */
if (mode == SLD_NEW_GAME || _fios_scn_path == NULL) {
if (_fios_scn_path == NULL) _fios_scn_path = malloc(MAX_PATH);
ttd_strlcpy(_fios_scn_path, _path.scenario_dir, MAX_PATH);
}
_fios_path = _fios_scn_path;