Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,9 @@ void W3DTreeBuffer::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: TheSuperHackers @tweak Serialize sink frames as float instead of integer
*/
// ------------------------------------------------------------------------------------------------
void W3DTreeBuffer::xfer( Xfer *xfer )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ class ParticleUplinkCannonUpdate : public UpdateModule, public SpecialPowerUpdat
UnsignedInt m_lastDrivingClickFrame;
UnsignedInt m_2ndLastDrivingClickFrame;

XferVersion m_xferVersion;

Bool m_upBonesCached;
Bool m_defaultInfoCached;
Bool m_invalidSettings;
Expand Down
5 changes: 3 additions & 2 deletions Generals/Code/GameEngine/Source/Common/RTS/Money.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ void Money::crc( Xfer *xfer )
/** Xfer method
* Version Info:
* 1: Initial version
* 2: Add saveload support for the cash per minute income tracking */
* 2: TheSuperHackers @tweak Serialize income tracking
*/
// ------------------------------------------------------------------------------------------------
void Money::xfer( Xfer *xfer )
{
Expand Down Expand Up @@ -196,7 +197,7 @@ void Money::loadPostProcess( void )
// ------------------------------------------------------------------------------------------------
void Money::parseMoneyAmount( INI *ini, void *instance, void *store, const void* userData )
{
// Someday, maybe, have mulitple fields like Gold:10000 Wood:1000 Tiberian:10
// Someday, maybe, have multiple fields like Gold:10000 Wood:1000 Tiberian:10
Money * money = (Money *)store;
UnsignedInt moneyAmount;
INI::parseUnsignedInt( ini, instance, &moneyAmount, userData );
Expand Down
4 changes: 3 additions & 1 deletion Generals/Code/GameEngine/Source/GameClient/Drawable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4858,7 +4858,9 @@ void TintEnvelope::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer Method
* Version Info;
* 1: Initial version */
* 1: Initial version
* 2: TheSuperHackers @tweak Serialize sustain counter as float instead of integer
*/
// ------------------------------------------------------------------------------------------------
void TintEnvelope::xfer( Xfer *xfer )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ void PoisonedBehavior::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: Serialize death type
* 3: TheSuperHackers @tweak Serialize poison source
*/
// ------------------------------------------------------------------------------------------------
void PoisonedBehavior::xfer( Xfer *xfer )
{
Expand Down Expand Up @@ -239,12 +242,10 @@ void PoisonedBehavior::xfer( Xfer *xfer )
xfer->xferUser(&m_deathType, sizeof(m_deathType));
}

#if !RETAIL_COMPATIBLE_XFER_SAVE
if (version >= 3)
{
xfer->xferObjectID(&m_poisonSource);
}
#endif
}

// ------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ void FlammableUpdate::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2. TheSuperHackers @tweak Serialize flame source
*/
// ------------------------------------------------------------------------------------------------
void FlammableUpdate::xfer( Xfer *xfer )
{
Expand Down Expand Up @@ -320,12 +322,10 @@ void FlammableUpdate::xfer( Xfer *xfer )
// last flame damage dealt
xfer->xferUnsignedInt( &m_lastFlameDamageDealt );

#if !RETAIL_COMPATIBLE_XFER_SAVE
if (version >= 2)
{
xfer->xferObjectID(&m_flameSource);
}
#endif
}

// ------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ ParticleUplinkCannonUpdate::ParticleUplinkCannonUpdate( Thing *thing, const Modu
m_defaultInfoCached = false;
m_invalidSettings = false;
m_manualTargetMode = false;
m_xferVersion = 1;
m_initialTargetPosition.zero();
m_currentTargetPosition.zero();
m_overrideTargetDestination.zero();
Expand Down Expand Up @@ -1308,7 +1309,10 @@ void ParticleUplinkCannonUpdate::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: Serialize decay frames
* 4: TheSuperHackers @tweak Serialize orbit to target laser radius
*/
// ------------------------------------------------------------------------------------------------
void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
{
Expand All @@ -1322,6 +1326,7 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );
m_xferVersion = version;

// extend base class
UpdateModule::xfer( xfer );
Expand Down Expand Up @@ -1436,27 +1441,28 @@ void ParticleUplinkCannonUpdate::loadPostProcess( void )
// extend base class
UpdateModule::loadPostProcess();

#if RETAIL_COMPATIBLE_XFER_SAVE
// TheSuperHackers @info xezon 17/05/2025
// For retail game compatibility, this transfers the loaded visual laser radius
// settings from the Drawable's LaserUpdate to the local LaserRadiusUpdate.
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID )
if (m_xferVersion <= 3)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I replaced

#if RETAIL_COMPATIBLE_XFER_SAVE with if (m_xferVersion <= 3)

because it makes no sense to only do this load correction when RETAIL_COMPATIBLE_XFER_SAVE is compiled in.

{
Drawable* drawable = TheGameClient->findDrawableByID( m_orbitToTargetBeamID );
if( drawable != NULL )
// TheSuperHackers @info xezon 17/05/2025
// For retail game compatibility, this transfers the loaded visual laser radius
// settings from the Drawable's LaserUpdate to the local LaserRadiusUpdate.
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID )
{
static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" );
LaserUpdate *update = (LaserUpdate*)drawable->findClientUpdateModule( nameKeyClientUpdate );
if( update != NULL )
Drawable* drawable = TheGameClient->findDrawableByID( m_orbitToTargetBeamID );
if( drawable != NULL )
{
m_orbitToTargetLaserRadius = update->getLaserRadiusUpdate();
static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" );
LaserUpdate *update = (LaserUpdate*)drawable->findClientUpdateModule( nameKeyClientUpdate );
if( update != NULL )
{
m_orbitToTargetLaserRadius = update->getLaserRadiusUpdate();
}
}
else
{
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
}
}
else
{
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
}
}
#endif

}
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ class ParticleUplinkCannonUpdate : public SpecialPowerUpdateModule
UnsignedInt m_2ndLastDrivingClickFrame;
UnsignedInt m_nextDestWaypointID;

XferVersion m_xferVersion;

Bool m_upBonesCached;
Bool m_defaultInfoCached;
Bool m_invalidSettings;
Expand Down
5 changes: 3 additions & 2 deletions GeneralsMD/Code/GameEngine/Source/Common/RTS/Money.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ void Money::crc( Xfer *xfer )
/** Xfer method
* Version Info:
* 1: Initial version
* 2: Add saveload support for the cash per minute income tracking */
* 2: TheSuperHackers @tweak Serialize income tracking
*/
// ------------------------------------------------------------------------------------------------
void Money::xfer( Xfer *xfer )
{
Expand Down Expand Up @@ -205,7 +206,7 @@ void Money::loadPostProcess( void )
// ------------------------------------------------------------------------------------------------
void Money::parseMoneyAmount( INI *ini, void *instance, void *store, const void* userData )
{
// Someday, maybe, have mulitple fields like Gold:10000 Wood:1000 Tiberian:10
// Someday, maybe, have multiple fields like Gold:10000 Wood:1000 Tiberian:10
Money * money = (Money *)store;
UnsignedInt moneyAmount;
INI::parseUnsignedInt( ini, instance, &moneyAmount, userData );
Expand Down
4 changes: 3 additions & 1 deletion GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5615,7 +5615,9 @@ void TintEnvelope::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer Method
* Version Info;
* 1: Initial version */
* 1: Initial version
* 2: TheSuperHackers @tweak Serialize sustain counter as float instead of integer
*/
// ------------------------------------------------------------------------------------------------
void TintEnvelope::xfer( Xfer *xfer )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ void PoisonedBehavior::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: Serialize death type
* 3: TheSuperHackers @tweak Serialize poison source
*/
// ------------------------------------------------------------------------------------------------
void PoisonedBehavior::xfer( Xfer *xfer )
{
Expand Down Expand Up @@ -240,12 +243,10 @@ void PoisonedBehavior::xfer( Xfer *xfer )
xfer->xferUser(&m_deathType, sizeof(m_deathType));
}

#if !RETAIL_COMPATIBLE_XFER_SAVE
if (version >= 3)
{
xfer->xferObjectID(&m_poisonSource);
}
#endif
}

// ------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ void FlammableUpdate::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2. TheSuperHackers @tweak Serialize flame source
*/
// ------------------------------------------------------------------------------------------------
void FlammableUpdate::xfer( Xfer *xfer )
{
Expand Down Expand Up @@ -320,12 +322,10 @@ void FlammableUpdate::xfer( Xfer *xfer )
// last flame damage dealt
xfer->xferUnsignedInt( &m_lastFlameDamageDealt );

#if !RETAIL_COMPATIBLE_XFER_SAVE
if (version >= 2)
{
xfer->xferObjectID(&m_flameSource);
}
#endif
}

// ------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ ParticleUplinkCannonUpdate::ParticleUplinkCannonUpdate( Thing *thing, const Modu
m_manualTargetMode = FALSE;
m_scriptedWaypointMode = FALSE;
m_nextDestWaypointID = 0;
m_xferVersion = 1;
m_initialTargetPosition.zero();
m_currentTargetPosition.zero();
m_overrideTargetDestination.zero();
Expand Down Expand Up @@ -1392,7 +1393,11 @@ void ParticleUplinkCannonUpdate::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: Serialize decay frames
* 3: Serialize scripted waypoints (Added for Zero Hour)
* 4: TheSuperHackers @tweak Serialize orbit to target laser radius
*/
// ------------------------------------------------------------------------------------------------
void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
{
Expand All @@ -1406,6 +1411,7 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );
m_xferVersion = version;

// extend base class
UpdateModule::xfer( xfer );
Expand Down Expand Up @@ -1527,27 +1533,28 @@ void ParticleUplinkCannonUpdate::loadPostProcess( void )
// extend base class
UpdateModule::loadPostProcess();

#if RETAIL_COMPATIBLE_XFER_SAVE
// TheSuperHackers @info xezon 17/05/2025
// For retail game compatibility, this transfers the loaded visual laser radius
// settings from the Drawable's LaserUpdate to the local LaserRadiusUpdate.
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID )
if (m_xferVersion <= 3)
{
Drawable* drawable = TheGameClient->findDrawableByID( m_orbitToTargetBeamID );
if( drawable != NULL )
// TheSuperHackers @info xezon 17/05/2025
// For retail game compatibility, this transfers the loaded visual laser radius
// settings from the Drawable's LaserUpdate to the local LaserRadiusUpdate.
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID )
{
static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" );
LaserUpdate *update = (LaserUpdate*)drawable->findClientUpdateModule( nameKeyClientUpdate );
if( update != NULL )
Drawable* drawable = TheGameClient->findDrawableByID( m_orbitToTargetBeamID );
if( drawable != NULL )
{
m_orbitToTargetLaserRadius = update->getLaserRadiusUpdate();
static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" );
LaserUpdate *update = (LaserUpdate*)drawable->findClientUpdateModule( nameKeyClientUpdate );
if( update != NULL )
{
m_orbitToTargetLaserRadius = update->getLaserRadiusUpdate();
}
}
else
{
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
}
}
else
{
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
}
}
#endif

}
Loading