diff --git a/Generals/Code/GameEngine/Include/GameLogic/Scripts.h b/Generals/Code/GameEngine/Include/GameLogic/Scripts.h index c2a85ecfd0f..a69bf56c69a 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/Scripts.h +++ b/Generals/Code/GameEngine/Include/GameLogic/Scripts.h @@ -616,9 +616,9 @@ class Script : public MemoryPoolObject, public Snapshot ScriptAction *m_action; ///< First in a list of actions executed if the conditions are true. ScriptAction *m_actionFalse;///< First in a list of actions executed if the conditions are false. Script *m_nextScript; ///< Next in the list of scripts. + UnsignedInt m_frameToEvaluateAt; ///< When to evaluate the conditions next, if m_delayEvaluationSeconds>0. // Runtime fields - not saved or read. - UnsignedInt m_frameToEvaluateAt; ///< When to evaluate the conditions next, if m_delayEvaluationSeconds>0. Bool m_hasWarnings; ///< Runtime flag used by the editor only. AsciiString m_conditionTeamName; ///< Runtime name used by ScriptEngine only. Real m_conditionTime; ///< Amount of time (cum) to evaluate conditions. diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index 74263ba13ef..cc6b5542fdb 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -941,13 +941,19 @@ void Script::crc( Xfer *xfer ) // ------------------------------------------------------------------------------------------------ /** Xfer method * Version Info: - * 1: Initial version */ + * 1: Initial version + * 2: TheSuperHackers @bugfix bobtista 13/08/2026 Save the next evaluation frame of delayed scripts + */ // ------------------------------------------------------------------------------------------------ void Script::xfer( Xfer *xfer ) { // version +#if RETAIL_COMPATIBLE_XFER_SAVE XferVersion currentVersion = 1; +#else + XferVersion currentVersion = 2; +#endif XferVersion version = currentVersion; xfer->xferVersion( &version, currentVersion ); @@ -956,6 +962,11 @@ void Script::xfer( Xfer *xfer ) xfer->xferBool( &active ); setActive( active ); + if( version >= 2 ) + { + xfer->xferUnsignedInt( &m_frameToEvaluateAt ); + } + } // ------------------------------------------------------------------------------------------------ diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Scripts.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Scripts.h index 9343b6ff0cc..859e416369e 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Scripts.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Scripts.h @@ -624,9 +624,9 @@ class Script : public MemoryPoolObject, public Snapshot ScriptAction *m_action; ///< First in a list of actions executed if the conditions are true. ScriptAction *m_actionFalse;///< First in a list of actions executed if the conditions are false. Script *m_nextScript; ///< Next in the list of scripts. + UnsignedInt m_frameToEvaluateAt; ///< When to evaluate the conditions next, if m_delayEvaluationSeconds>0. // Runtime fields - not saved or read. - UnsignedInt m_frameToEvaluateAt; ///< When to evaluate the conditions next, if m_delayEvaluationSeconds>0. Bool m_hasWarnings; ///< Runtime flag used by the editor only. AsciiString m_conditionTeamName; ///< Runtime name used by ScriptEngine only. Real m_conditionTime; ///< Amount of time (cum) to evaluate conditions. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp index c9dd8a5efbe..1273c6671dc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/Scripts.cpp @@ -949,13 +949,19 @@ void Script::crc( Xfer *xfer ) // ------------------------------------------------------------------------------------------------ /** Xfer method * Version Info: - * 1: Initial version */ + * 1: Initial version + * 2: TheSuperHackers @bugfix bobtista 13/08/2026 Save the next evaluation frame of delayed scripts + */ // ------------------------------------------------------------------------------------------------ void Script::xfer( Xfer *xfer ) { // version +#if RETAIL_COMPATIBLE_XFER_SAVE XferVersion currentVersion = 1; +#else + XferVersion currentVersion = 2; +#endif XferVersion version = currentVersion; xfer->xferVersion( &version, currentVersion ); @@ -964,6 +970,11 @@ void Script::xfer( Xfer *xfer ) xfer->xferBool( &active ); setActive( active ); + if( version >= 2 ) + { + xfer->xferUnsignedInt( &m_frameToEvaluateAt ); + } + } // ------------------------------------------------------------------------------------------------