Skip to content

Commit 623e80f

Browse files
authored
Merge pull request #576 from Jaredl-Dev/fix/one-frame-attached-particle-visibility-60hz
- Fix one-frame attached particle visibility at 60Hz
2 parents 1391597 + 055da68 commit 623e80f

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

‎Core/GameEngine/Source/GameClient/System/ParticleSys.cpp‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,13 +1427,22 @@ void ParticleSystem::rotateLocalTransformZ( Real z )
14271427
// ------------------------------------------------------------------------------------------------
14281428
/** Attach this particle system to a Drawable */
14291429
// ------------------------------------------------------------------------------------------------
1430-
void ParticleSystem::attachToDrawable( const Drawable *draw )
1431-
{
1432-
if (draw)
1433-
m_attachedToDrawableID = draw->getID();
1434-
else
1435-
m_attachedToDrawableID = INVALID_DRAWABLE_ID;
1436-
}
1430+
void ParticleSystem::attachToDrawable( const Drawable *draw )
1431+
{
1432+
if (draw)
1433+
{
1434+
m_attachedToDrawableID = draw->getID();
1435+
1436+
#if defined(GENERALS_ONLINE_HIGH_FPS_RENDER)
1437+
// Info: One-frame attached systems can otherwise lose their only burst when the drawable is created and destroyed
1438+
// between legacy particle updates at 60Hz.
1439+
if (m_systemLifetimeLeft == 1 && m_delayLeft == 0 && getParticleCount() == 0)
1440+
update(0);
1441+
#endif
1442+
}
1443+
else
1444+
m_attachedToDrawableID = INVALID_DRAWABLE_ID;
1445+
}
14371446

14381447
// ------------------------------------------------------------------------------------------------
14391448
/** Attach this particle system to a Drawable */

0 commit comments

Comments
 (0)