mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #3425 from Gymnasiast/load-sv4-from-dialog
Enable SV4 files to be loaded from the native load/save dialog
This commit is contained in:
commit
aa77c06c01
15
src/game.c
15
src/game.c
|
@ -41,6 +41,7 @@
|
|||
#include "peep/peep.h"
|
||||
#include "peep/staff.h"
|
||||
#include "platform/platform.h"
|
||||
#include "rct1.h"
|
||||
#include "ride/ride.h"
|
||||
#include "ride/ride_ratings.h"
|
||||
#include "ride/vehicle.h"
|
||||
|
@ -933,7 +934,17 @@ bool game_load_save(const utf8 *path)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool result = game_load_sv6(rw);
|
||||
uint32 extension_type = get_file_extension_type(path);
|
||||
bool result = false;
|
||||
|
||||
if (extension_type == FILE_EXTENSION_SV6) {
|
||||
result = game_load_sv6(rw);
|
||||
} else if (extension_type == FILE_EXTENSION_SV4) {
|
||||
result = rct1_load_saved_game(path);
|
||||
if (result)
|
||||
gFirstTimeSave = 1;
|
||||
}
|
||||
|
||||
SDL_RWclose(rw);
|
||||
|
||||
if (result) {
|
||||
|
@ -946,7 +957,7 @@ bool game_load_save(const utf8 *path)
|
|||
}
|
||||
return true;
|
||||
} else {
|
||||
// If loading the SV6 failed, the current park state will be corrupted
|
||||
// If loading the SV6 or SV4 failed, the current park state will be corrupted
|
||||
// so just go back to the title screen.
|
||||
title_load();
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue