Fix 39e90ec: Integers for scripts are 64bit, but saved as 32bit (#9415)

(cherry picked from commit ddafc0de05)
This commit is contained in:
Loïc Guilloux
2021-07-06 21:09:08 +02:00
committed by Jonathan G Rennison
parent fb8020916a
commit a84feb3444
4 changed files with 8 additions and 6 deletions

View File

@@ -388,8 +388,8 @@ static const SaveLoad _script_byte[] = {
SQInteger res;
sq_getinteger(vm, index, &res);
if (!test) {
int value = (int)res;
SlArray(&value, 1, SLE_INT32);
int64 value = (int64)res;
SlArray(&value, 1, SLE_INT64);
}
return true;
}
@@ -588,8 +588,8 @@ bool ScriptInstance::IsPaused()
SlObject(nullptr, _script_byte);
switch (_script_sl_byte) {
case SQSL_INT: {
int value;
SlArray(&value, 1, SLE_INT32);
int64 value;
SlArray(&value, 1, (IsSavegameVersionBefore(SLV_SCRIPT_INT64) && SlXvIsFeatureMissing(XSLFI_SCRIPT_INT64)) ? SLE_FILE_I32 | SLE_VAR_I64 : SLE_INT64);
if (vm != nullptr) sq_pushinteger(vm, (SQInteger)value);
return true;
}