mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Enable SV4 files to be loaded from the native load/save dialog
This commit is contained in:
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,19 @@ bool game_load_save(const utf8 *path)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool result = game_load_sv6(rw);
|
||||
char *extension = strrchr(path, '.');
|
||||
if (extension == NULL) {
|
||||
return false;
|
||||
}
|
||||
extension++;
|
||||
|
||||
bool result = false;
|
||||
if (_stricmp(extension, "sv6") == 0) {
|
||||
result = game_load_sv6(rw);
|
||||
} else if (_stricmp(extension, "sv4") == 0) {
|
||||
result = rct1_load_saved_game(path);
|
||||
}
|
||||
|
||||
SDL_RWclose(rw);
|
||||
|
||||
if (result) {
|
||||
|
||||
Reference in New Issue
Block a user