(cherry picked from commit 1d9bc23525
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
cc22351ef4
commit
6c19e5ecae
@@ -29,6 +29,8 @@
|
|||||||
#include "../fileio_func.h"
|
#include "../fileio_func.h"
|
||||||
#include "../league_type.h"
|
#include "../league_type.h"
|
||||||
|
|
||||||
|
#include "../3rdparty/fmt/format.h"
|
||||||
|
|
||||||
#include "../safeguards.h"
|
#include "../safeguards.h"
|
||||||
|
|
||||||
ScriptStorage::~ScriptStorage()
|
ScriptStorage::~ScriptStorage()
|
||||||
@@ -731,9 +733,16 @@ void ScriptInstance::LoadOnStack(ScriptData *data)
|
|||||||
|
|
||||||
ScriptDataVariant version = data->front();
|
ScriptDataVariant version = data->front();
|
||||||
data->pop_front();
|
data->pop_front();
|
||||||
|
SQInteger top = sq_gettop(vm);
|
||||||
|
try {
|
||||||
sq_pushinteger(vm, std::get<SQInteger>(version));
|
sq_pushinteger(vm, std::get<SQInteger>(version));
|
||||||
LoadObjects(vm, data);
|
LoadObjects(vm, data);
|
||||||
this->is_save_data_on_stack = true;
|
this->is_save_data_on_stack = true;
|
||||||
|
} catch (Script_FatalError &e) {
|
||||||
|
ScriptLog::Warning(fmt::format("Loading failed: {}", e.GetErrorMessage()).c_str());
|
||||||
|
/* Discard partially loaded savegame data and version. */
|
||||||
|
sq_settop(vm, top);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScriptInstance::CallLoad()
|
bool ScriptInstance::CallLoad()
|
||||||
|
Reference in New Issue
Block a user