Skip to content

Commit 21a219f

Browse files
committed
Replicate in Generals
1 parent 0fd1023 commit 21a219f

File tree

6 files changed

+38
-26
lines changed

6 files changed

+38
-26
lines changed

Generals/Code/GameEngine/Include/GameLogic/Module/ParticleUplinkCannonUpdate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ class ParticleUplinkCannonUpdate : public UpdateModule, public SpecialPowerUpdat
228228
UnsignedInt m_lastDrivingClickFrame;
229229
UnsignedInt m_2ndLastDrivingClickFrame;
230230

231+
XferVersion m_xferVersion;
232+
231233
Bool m_upBonesCached;
232234
Bool m_defaultInfoCached;
233235
Bool m_invalidSettings;

Generals/Code/GameEngine/Source/Common/RTS/Money.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ void Money::crc( Xfer *xfer )
152152
/** Xfer method
153153
* Version Info:
154154
* 1: Initial version
155-
* 2: Add saveload support for the cash per minute income tracking */
155+
* 2: TheSuperHackers @tweak Serialize income tracking
156+
*/
156157
// ------------------------------------------------------------------------------------------------
157158
void Money::xfer( Xfer *xfer )
158159
{
@@ -196,7 +197,7 @@ void Money::loadPostProcess( void )
196197
// ------------------------------------------------------------------------------------------------
197198
void Money::parseMoneyAmount( INI *ini, void *instance, void *store, const void* userData )
198199
{
199-
// Someday, maybe, have mulitple fields like Gold:10000 Wood:1000 Tiberian:10
200+
// Someday, maybe, have multiple fields like Gold:10000 Wood:1000 Tiberian:10
200201
Money * money = (Money *)store;
201202
UnsignedInt moneyAmount;
202203
INI::parseUnsignedInt( ini, instance, &moneyAmount, userData );

Generals/Code/GameEngine/Source/GameClient/Drawable.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4858,7 +4858,9 @@ void TintEnvelope::crc( Xfer *xfer )
48584858
// ------------------------------------------------------------------------------------------------
48594859
/** Xfer Method
48604860
* Version Info;
4861-
* 1: Initial version */
4861+
* 1: Initial version
4862+
* 2: TheSuperHackers @tweak Serialize sustain counter as float instead of integer
4863+
*/
48624864
// ------------------------------------------------------------------------------------------------
48634865
void TintEnvelope::xfer( Xfer *xfer )
48644866
{

Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,10 @@ void PoisonedBehavior::crc( Xfer *xfer )
208208
// ------------------------------------------------------------------------------------------------
209209
/** Xfer method
210210
* Version Info:
211-
* 1: Initial version */
211+
* 1: Initial version
212+
* 2: Serialize death type
213+
* 3: TheSuperHackers @tweak Serialize poison source
214+
*/
212215
// ------------------------------------------------------------------------------------------------
213216
void PoisonedBehavior::xfer( Xfer *xfer )
214217
{
@@ -239,12 +242,10 @@ void PoisonedBehavior::xfer( Xfer *xfer )
239242
xfer->xferUser(&m_deathType, sizeof(m_deathType));
240243
}
241244

242-
#if !RETAIL_COMPATIBLE_XFER_SAVE
243245
if (version >= 3)
244246
{
245247
xfer->xferObjectID(&m_poisonSource);
246248
}
247-
#endif
248249
}
249250

250251
// ------------------------------------------------------------------------------------------------

Generals/Code/GameEngine/Source/GameLogic/Object/Update/FlammableUpdate.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ void FlammableUpdate::crc( Xfer *xfer )
285285
// ------------------------------------------------------------------------------------------------
286286
/** Xfer method
287287
* Version Info:
288-
* 1: Initial version */
288+
* 1: Initial version
289+
* 2. TheSuperHackers @tweak Serialize flame source
290+
*/
289291
// ------------------------------------------------------------------------------------------------
290292
void FlammableUpdate::xfer( Xfer *xfer )
291293
{
@@ -320,12 +322,10 @@ void FlammableUpdate::xfer( Xfer *xfer )
320322
// last flame damage dealt
321323
xfer->xferUnsignedInt( &m_lastFlameDamageDealt );
322324

323-
#if !RETAIL_COMPATIBLE_XFER_SAVE
324325
if (version >= 2)
325326
{
326327
xfer->xferObjectID(&m_flameSource);
327328
}
328-
#endif
329329
}
330330

331331
// ------------------------------------------------------------------------------------------------

Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ ParticleUplinkCannonUpdate::ParticleUplinkCannonUpdate( Thing *thing, const Modu
173173
m_defaultInfoCached = false;
174174
m_invalidSettings = false;
175175
m_manualTargetMode = false;
176+
m_xferVersion = 1;
176177
m_initialTargetPosition.zero();
177178
m_currentTargetPosition.zero();
178179
m_overrideTargetDestination.zero();
@@ -1308,7 +1309,10 @@ void ParticleUplinkCannonUpdate::crc( Xfer *xfer )
13081309
// ------------------------------------------------------------------------------------------------
13091310
/** Xfer method
13101311
* Version Info:
1311-
* 1: Initial version */
1312+
* 1: Initial version
1313+
* 2: Serialize decay frames
1314+
* 4: TheSuperHackers @tweak Serialize orbit to target laser radius
1315+
*/
13121316
// ------------------------------------------------------------------------------------------------
13131317
void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
13141318
{
@@ -1322,6 +1326,7 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
13221326
#endif
13231327
XferVersion version = currentVersion;
13241328
xfer->xferVersion( &version, currentVersion );
1329+
m_xferVersion = version;
13251330

13261331
// extend base class
13271332
UpdateModule::xfer( xfer );
@@ -1436,27 +1441,28 @@ void ParticleUplinkCannonUpdate::loadPostProcess( void )
14361441
// extend base class
14371442
UpdateModule::loadPostProcess();
14381443

1439-
#if RETAIL_COMPATIBLE_XFER_SAVE
1440-
// TheSuperHackers @info xezon 17/05/2025
1441-
// For retail game compatibility, this transfers the loaded visual laser radius
1442-
// settings from the Drawable's LaserUpdate to the local LaserRadiusUpdate.
1443-
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID )
1444+
if (m_xferVersion <= 3)
14441445
{
1445-
Drawable* drawable = TheGameClient->findDrawableByID( m_orbitToTargetBeamID );
1446-
if( drawable != NULL )
1446+
// TheSuperHackers @info xezon 17/05/2025
1447+
// For retail game compatibility, this transfers the loaded visual laser radius
1448+
// settings from the Drawable's LaserUpdate to the local LaserRadiusUpdate.
1449+
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID )
14471450
{
1448-
static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" );
1449-
LaserUpdate *update = (LaserUpdate*)drawable->findClientUpdateModule( nameKeyClientUpdate );
1450-
if( update != NULL )
1451+
Drawable* drawable = TheGameClient->findDrawableByID( m_orbitToTargetBeamID );
1452+
if( drawable != NULL )
14511453
{
1452-
m_orbitToTargetLaserRadius = update->getLaserRadiusUpdate();
1454+
static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" );
1455+
LaserUpdate *update = (LaserUpdate*)drawable->findClientUpdateModule( nameKeyClientUpdate );
1456+
if( update != NULL )
1457+
{
1458+
m_orbitToTargetLaserRadius = update->getLaserRadiusUpdate();
1459+
}
1460+
}
1461+
else
1462+
{
1463+
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
14531464
}
1454-
}
1455-
else
1456-
{
1457-
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
14581465
}
14591466
}
1460-
#endif
14611467

14621468
}

0 commit comments

Comments
 (0)