mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-27 14:14:27 +01:00
(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.
This commit is contained in:
7
os2.c
7
os2.c
@@ -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
7
unix.c
@@ -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;
|
||||
|
||||
7
win32.c
7
win32.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user