mirror of https://github.com/OpenRCT2/OpenRCT2.git
remove network type from loadsave
Fixes a crash that happened when loading a saved game from the start server window.
This commit is contained in:
parent
7eeb59b1aa
commit
16527e749a
|
@ -487,8 +487,6 @@ enum {
|
|||
LOADSAVETYPE_LANDSCAPE = 1 << 1,
|
||||
LOADSAVETYPE_SCENARIO = 2 << 1,
|
||||
LOADSAVETYPE_TRACK = 3 << 1,
|
||||
|
||||
LOADSAVETYPE_NETWORK = 1 << 4,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
@ -189,6 +189,9 @@ rct_window *window_loadsave_open(int type, char *defaultName)
|
|||
case (LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK) :
|
||||
w->widgets[WIDX_TITLE].image = STR_FILE_DIALOG_TITLE_INSTALL_NEW_TRACK_DESIGN;
|
||||
break;
|
||||
default:
|
||||
log_error("Unsupported load / save type: %d", type & 0x0F);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
w->no_list_items = 0;
|
||||
|
@ -727,10 +730,6 @@ static void window_loadsave_select(rct_window *w, const char *path)
|
|||
}
|
||||
window_loadsave_invoke_callback(MODAL_RESULT_OK);
|
||||
} else if (game_load_save(path)) {
|
||||
if (_loadsaveType & LOADSAVETYPE_NETWORK) {
|
||||
network_begin_server(gConfigNetwork.default_port);
|
||||
}
|
||||
|
||||
safe_strcpy(gScenarioSavePath, path, MAX_PATH);
|
||||
gFirstTimeSave = 0;
|
||||
|
||||
|
|
|
@ -160,6 +160,13 @@ static void window_server_start_scenarioselect_callback(const utf8 *path)
|
|||
}
|
||||
}
|
||||
|
||||
static void window_server_start_loadsave_callback(int result)
|
||||
{
|
||||
if (result == MODAL_RESULT_OK) {
|
||||
network_begin_server(gConfigNetwork.default_port);
|
||||
}
|
||||
}
|
||||
|
||||
static void window_server_start_mouseup(rct_window *w, int widgetIndex)
|
||||
{
|
||||
switch (widgetIndex) {
|
||||
|
@ -199,7 +206,8 @@ static void window_server_start_mouseup(rct_window *w, int widgetIndex)
|
|||
break;
|
||||
case WIDX_LOAD_SERVER:
|
||||
network_set_password(_password);
|
||||
window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME | LOADSAVETYPE_NETWORK, NULL);
|
||||
window_loadsave_open(LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME, NULL);
|
||||
gLoadSaveCallback = window_server_start_loadsave_callback;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue