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 @@ -72,6 +72,7 @@ class DeletionUpdate : public UpdateModule
// virtual destructor prototype provided by memory pool declaration

void setLifetimeRange( UnsignedInt minFrames, UnsignedInt maxFrames );
void restartLifetime();
UnsignedInt getDieFrame() { return m_dieFrame; }

virtual UpdateSleepTime update() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "GameLogic/AIPathfind.h"
#include "GameLogic/Locomotor.h"
#include "GameLogic/Module/AIUpdate.h"
#include "GameLogic/Module/DeletionUpdate.h"
#include "GameLogic/Module/ParachuteContain.h"
#include "GameLogic/Module/PhysicsUpdate.h"
#include "GameLogic/Object.h"
Expand Down Expand Up @@ -469,6 +470,16 @@ void ParachuteContain::onRemoving( Object *rider )
const ParachuteContainModuleData* d = getParachuteContainModuleData();

// object is no longer held inside a transport
#if defined(GENERALS_ONLINE_HIGH_FPS_SERVER)
// Info: At 60Hz, a short-lived object can reach its DeletionUpdate lifetime while parachuting, then be destroyed
// before its delayed OCLUpdate runs after landing. Restart an expired lifetime before releasing the object.
static NameKeyType key_DeletionUpdate = NAMEKEY( "DeletionUpdate" );
DeletionUpdate *dup = (DeletionUpdate*)rider->findUpdateModule( key_DeletionUpdate );
if (dup && dup->getDieFrame() <= TheGameLogic->getFrame())
{
dup->restartLifetime();
}
#endif
rider->clearDisabled( DISABLED_HELD );
rider->clearStatus( MAKE_OBJECT_STATUS_MASK( OBJECT_STATUS_PARACHUTING ) );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ void DeletionUpdate::setLifetimeRange( UnsignedInt minFrames, UnsignedInt maxFra
#endif
}

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
void DeletionUpdate::restartLifetime()
{
const DeletionUpdateModuleData *d = getDeletionUpdateModuleData();
setLifetimeRange( d->m_minFrames, d->m_maxFrames );
}

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
UnsignedInt DeletionUpdate::calcSleepDelay(UnsignedInt minFrames, UnsignedInt maxFrames)
Expand Down
Loading