1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 06:23:04 +01:00

Allow loading saved games in editor

This commit is contained in:
Ted John
2016-10-03 19:14:26 +01:00
parent 9359379d29
commit 5e554ebdcb
3 changed files with 44 additions and 1 deletions

View File

@@ -400,6 +400,41 @@ extern "C"
return result;
}
bool game_load_sv6_path(const char * path)
{
bool result = false;
auto s6Importer = new S6Importer();
try
{
s6Importer->FixIssues = true;
s6Importer->LoadSavedGame(path);
s6Importer->Import();
openrct2_reset_object_tween_locations();
result = true;
}
catch (ObjectLoadException)
{
gErrorType = ERROR_TYPE_FILE_LOAD;
gErrorStringId = STR_GAME_SAVE_FAILED;
}
catch (IOException)
{
gErrorType = ERROR_TYPE_FILE_LOAD;
gErrorStringId = STR_GAME_SAVE_FAILED;
}
catch (Exception)
{
gErrorType = ERROR_TYPE_FILE_LOAD;
gErrorStringId = STR_FILE_CONTAINS_INVALID_DATA;
}
delete s6Importer;
gScreenAge = 0;
gLastAutoSaveTick = SDL_GetTicks();
return result;
}
/**
*
* rct2: 0x00676053