mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
This commit is contained in:
parent
8913ae9ba8
commit
ddafc0de05
@ -335,6 +335,7 @@ enum SaveLoadVersion : uint16 {
|
|||||||
SLV_RIFF_TO_ARRAY, ///< 294 PR#9375 Changed many CH_RIFF chunks to CH_ARRAY chunks.
|
SLV_RIFF_TO_ARRAY, ///< 294 PR#9375 Changed many CH_RIFF chunks to CH_ARRAY chunks.
|
||||||
|
|
||||||
SLV_TABLE_CHUNKS, ///< 295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE.
|
SLV_TABLE_CHUNKS, ///< 295 PR#9322 Introduction of CH_TABLE and CH_SPARSE_TABLE.
|
||||||
|
SLV_SCRIPT_INT64, ///< 296 PR#9415 SQInteger is 64bit but was saved as 32bit.
|
||||||
|
|
||||||
SL_MAX_VERSION, ///< Highest possible saveload version
|
SL_MAX_VERSION, ///< Highest possible saveload version
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
* data from the loaded game.
|
* data from the loaded game.
|
||||||
* - Finally, #Start is called to start execution of the script.
|
* - Finally, #Start is called to start execution of the script.
|
||||||
*
|
*
|
||||||
* See also http://wiki.openttd.org/AI:Save/Load for more details.
|
* See also https://wiki.openttd.org/en/Development/Script/Save%20and%20Load for more details.
|
||||||
*
|
*
|
||||||
* @api ai game
|
* @api ai game
|
||||||
*/
|
*/
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
* notified of the call. To avoid race-conditions between #Save and the
|
* notified of the call. To avoid race-conditions between #Save and the
|
||||||
* other script code, change variables directly after a #Sleep, it is
|
* other script code, change variables directly after a #Sleep, it is
|
||||||
* very unlikely, to get interrupted at that point in the execution.
|
* very unlikely, to get interrupted at that point in the execution.
|
||||||
* See also http://wiki.openttd.org/AI:Save/Load for more details.
|
* See also https://wiki.openttd.org/en/Development/Script/Save%20and%20Load for more details.
|
||||||
*
|
*
|
||||||
* @note No other information is saved than the table returned by #Save.
|
* @note No other information is saved than the table returned by #Save.
|
||||||
* For example all pending events are lost as soon as the game is loaded.
|
* For example all pending events are lost as soon as the game is loaded.
|
||||||
|
@ -364,8 +364,8 @@ static const SaveLoad _script_byte[] = {
|
|||||||
SQInteger res;
|
SQInteger res;
|
||||||
sq_getinteger(vm, index, &res);
|
sq_getinteger(vm, index, &res);
|
||||||
if (!test) {
|
if (!test) {
|
||||||
int value = (int)res;
|
int64 value = (int64)res;
|
||||||
SlCopy(&value, 1, SLE_INT32);
|
SlCopy(&value, 1, SLE_INT64);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -564,8 +564,8 @@ bool ScriptInstance::IsPaused()
|
|||||||
SlObject(nullptr, _script_byte);
|
SlObject(nullptr, _script_byte);
|
||||||
switch (_script_sl_byte) {
|
switch (_script_sl_byte) {
|
||||||
case SQSL_INT: {
|
case SQSL_INT: {
|
||||||
int value;
|
int64 value;
|
||||||
SlCopy(&value, 1, SLE_INT32);
|
SlCopy(&value, 1, IsSavegameVersionBefore(SLV_SCRIPT_INT64) ? SLE_INT32 : SLE_INT64);
|
||||||
if (vm != nullptr) sq_pushinteger(vm, (SQInteger)value);
|
if (vm != nullptr) sq_pushinteger(vm, (SQInteger)value);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user