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
27 changes: 14 additions & 13 deletions Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3638,19 +3638,6 @@ void Object::xfer( Xfer *xfer )
// private status
xfer->xferUnsignedByte( &m_privateStatus );

// OK, now that we have xferred our status bits, it's safe to set the team...
if( xfer->getXferMode() == XFER_LOAD )
{
Team *team = TheTeamFactory->findTeamByID( teamID );
if( team == nullptr )
{
DEBUG_CRASH(( "Object::xfer - Unable to load team" ));
throw SC_INVALID_DATA;
}
const Bool restoring = true;
setOrRestoreTeam( team, restoring );
}

// geometry info
xfer->xferSnapshot( &m_geometryInfo );

Expand Down Expand Up @@ -3693,6 +3680,20 @@ void Object::xfer( Xfer *xfer )
// disabled till frame
xfer->xferUser( m_disabledTillFrame, sizeof( UnsignedInt ) * DISABLED_COUNT );

// OK, now that we have xferred our status bits and disabled data, it's safe to set the team...
// TheSuperHackers @todo Refactor so that this code can be moved to loadPostProcess.
if( xfer->getXferMode() == XFER_LOAD )
{
Team *team = TheTeamFactory->findTeamByID( teamID );
if( team == nullptr )
{
DEBUG_CRASH(( "Object::xfer - Unable to load team" ));
throw SC_INVALID_DATA;
}
const Bool restoring = true;
setOrRestoreTeam( team, restoring );
}

// special model condition until
xfer->xferUnsignedInt( &m_smcUntil );

Expand Down
27 changes: 14 additions & 13 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4160,19 +4160,6 @@ void Object::xfer( Xfer *xfer )
// private status
xfer->xferUnsignedByte( &m_privateStatus );

// OK, now that we have xferred our status bits, it's safe to set the team...
if( xfer->getXferMode() == XFER_LOAD )
{
Team *team = TheTeamFactory->findTeamByID( teamID );
if( team == nullptr )
{
DEBUG_CRASH(( "Object::xfer - Unable to load team" ));
throw SC_INVALID_DATA;
}
const Bool restoring = true;
setOrRestoreTeam( team, restoring );
}

// geometry info
xfer->xferSnapshot( &m_geometryInfo );

Expand Down Expand Up @@ -4224,6 +4211,20 @@ void Object::xfer( Xfer *xfer )
// disabled till frame
xfer->xferUser( m_disabledTillFrame, sizeof( UnsignedInt ) * DISABLED_COUNT );

// OK, now that we have xferred our status bits and disabled data, it's safe to set the team...
// TheSuperHackers @todo Refactor so that this code can be moved to loadPostProcess.
if( xfer->getXferMode() == XFER_LOAD )
{
Team *team = TheTeamFactory->findTeamByID( teamID );
if( team == nullptr )
{
DEBUG_CRASH(( "Object::xfer - Unable to load team" ));
throw SC_INVALID_DATA;
}
const Bool restoring = true;
setOrRestoreTeam( team, restoring );
}

// special model condition until
xfer->xferUnsignedInt( &m_smcUntil );

Expand Down
Loading