Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,36 @@ void TurretStateMachine::crc( Xfer *xfer )
}

// ------------------------------------------------------------------------------------------------
/** Xfer Method */
/** Xfer Method
* Version Info:
* 1: Initial version
* 2: TheSuperHackers @bugfix bobtista 19/07/2026 Serialize the base StateMachine state.
* Without this the turret reverts to its default state on load.
*/
// ------------------------------------------------------------------------------------------------
void TurretStateMachine::xfer( Xfer *xfer )
{
XferVersion cv = 1;
XferVersion v = cv;
xfer->xferVersion( &v, cv );
// version
#if RETAIL_COMPATIBLE_XFER_SAVE
XferVersion currentVersion = 1;
#else
XferVersion currentVersion = 2;
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );

if (version >= 2)
{
StateMachine::xfer(xfer);
}
}

// ------------------------------------------------------------------------------------------------
/** Load post process */
// ------------------------------------------------------------------------------------------------
void TurretStateMachine::loadPostProcess()
{
StateMachine::loadPostProcess();
}

//----------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,23 +827,38 @@ void DozerActionStateMachine::crc( Xfer *xfer )
}

// ------------------------------------------------------------------------------------------------
/** Xfer Method */
/** Xfer Method
* Version Info:
* 1: Initial version
* 2: TheSuperHackers @bugfix bobtista 19/07/2026 Serialize the base StateMachine state.
* Without this the dozer reverts to its default state on load.
*/
// ------------------------------------------------------------------------------------------------
void DozerActionStateMachine::xfer( Xfer *xfer )
{
// version
#if RETAIL_COMPATIBLE_XFER_SAVE
XferVersion currentVersion = 1;
#else
XferVersion currentVersion = 2;
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );

xfer->xferUser(&m_task, sizeof(m_task));

if (version >= 2)
{
StateMachine::xfer(xfer);
}
}

// ------------------------------------------------------------------------------------------------
/** Load post process */
// ------------------------------------------------------------------------------------------------
void DozerActionStateMachine::loadPostProcess()
{
StateMachine::loadPostProcess();
}


Expand Down
23 changes: 19 additions & 4 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,36 @@ void TurretStateMachine::crc( Xfer *xfer )
}
Comment thread
Caball009 marked this conversation as resolved.

// ------------------------------------------------------------------------------------------------
/** Xfer Method */
/** Xfer Method
* Version Info:
* 1: Initial version
* 2: TheSuperHackers @bugfix bobtista 19/07/2026 Serialize the base StateMachine state.
* Without this the turret reverts to its default state on load.
*/
// ------------------------------------------------------------------------------------------------
void TurretStateMachine::xfer( Xfer *xfer )
{
XferVersion cv = 1;
XferVersion v = cv;
xfer->xferVersion( &v, cv );
// version
#if RETAIL_COMPATIBLE_XFER_SAVE
XferVersion currentVersion = 1;
#else
XferVersion currentVersion = 2;
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );

if (version >= 2)
{
StateMachine::xfer(xfer);
}
}

// ------------------------------------------------------------------------------------------------
/** Load post process */
// ------------------------------------------------------------------------------------------------
void TurretStateMachine::loadPostProcess()
{
StateMachine::loadPostProcess();
}

//----------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,23 +832,38 @@ void DozerActionStateMachine::crc( Xfer *xfer )
}

// ------------------------------------------------------------------------------------------------
/** Xfer Method */
/** Xfer Method
* Version Info:
* 1: Initial version
* 2: TheSuperHackers @bugfix bobtista 19/07/2026 Serialize the base StateMachine state.
* Without this the dozer reverts to its default state on load.
*/
// ------------------------------------------------------------------------------------------------
void DozerActionStateMachine::xfer( Xfer *xfer )
{
// version
#if RETAIL_COMPATIBLE_XFER_SAVE
XferVersion currentVersion = 1;
#else
XferVersion currentVersion = 2;
Comment thread
Caball009 marked this conversation as resolved.
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );

xfer->xferUser(&m_task, sizeof(m_task));

if (version >= 2)
{
StateMachine::xfer(xfer);
}
}

// ------------------------------------------------------------------------------------------------
/** Load post process */
// ------------------------------------------------------------------------------------------------
void DozerActionStateMachine::loadPostProcess()
{
StateMachine::loadPostProcess();
}


Expand Down
Loading