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 @@ -696,13 +696,18 @@ void DumbProjectileBehavior::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: TheSuperHackers @bugfix Added m_currentFlightPathStep for mid-flight save/load. */
// ------------------------------------------------------------------------------------------------
void DumbProjectileBehavior::xfer( Xfer *xfer )
{

// version
#if RETAIL_COMPATIBLE_XFER_SAVE
XferVersion currentVersion = 1;
#else
XferVersion currentVersion = 2;
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );

Expand Down Expand Up @@ -753,6 +758,12 @@ void DumbProjectileBehavior::xfer( Xfer *xfer )
// lifespan frame
xfer->xferUnsignedInt( &m_lifespanFrame );

// TheSuperHackers @bugfix Serialize current flight path step so projectiles can resume mid-flight on load.
if( version >= 2 )
{
xfer->xferInt( &m_currentFlightPathStep );
}

}

// ------------------------------------------------------------------------------------------------
Expand All @@ -764,4 +775,10 @@ void DumbProjectileBehavior::loadPostProcess()
// extend base class
UpdateModule::loadPostProcess();

// TheSuperHackers @bugfix Rebuild flight path on load to prevent immediate detonation of in-flight projectiles.
if( m_flightPathSegments > 0 )
{
calcFlightPath( false );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,18 @@ void DumbProjectileBehavior::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: TheSuperHackers @bugfix Added m_currentFlightPathStep for mid-flight save/load. */
// ------------------------------------------------------------------------------------------------
void DumbProjectileBehavior::xfer( Xfer *xfer )
{

// version
#if RETAIL_COMPATIBLE_XFER_SAVE
XferVersion currentVersion = 1;
#else
XferVersion currentVersion = 2;
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );

Expand Down Expand Up @@ -804,6 +809,12 @@ void DumbProjectileBehavior::xfer( Xfer *xfer )
// lifespan frame
xfer->xferUnsignedInt( &m_lifespanFrame );

// TheSuperHackers @bugfix Serialize current flight path step so projectiles can resume mid-flight on load.
if( version >= 2 )
{
xfer->xferInt( &m_currentFlightPathStep );
}

}

// ------------------------------------------------------------------------------------------------
Expand All @@ -815,4 +826,10 @@ void DumbProjectileBehavior::loadPostProcess()
// extend base class
UpdateModule::loadPostProcess();

// TheSuperHackers @bugfix Rebuild flight path on load to prevent immediate detonation of in-flight projectiles.
if( m_flightPathSegments > 0 )
{
calcFlightPath( false );
}

}
Loading