Skip to content

Commit 3d7c95f

Browse files
committed
Simplify particle system update comment
1 parent adf466c commit 3d7c95f

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -783,18 +783,9 @@ void GameClient::step()
783783

784784
void GameClient::updateHeadless()
785785
{
786-
// TheSuperHackers @info helmutbuhler 03/05/2025
787-
// When we play a replay back in headless mode, we want to skip the update of GameClient
788-
// because it's not necessary for CRC checking.
789-
// But we do update the particles. The problem is that particles can be generated during
790-
// GameLogic and are only cleaned up during rendering. If we don't clean this up here,
791-
// the particles accumulate and slow things down a lot and can even cause a crash on
792-
// longer replays.
793-
// TheSuperHackers @fix bobtista 02/02/2026 Use update() instead of reset() to avoid
794-
// use-after-free crash. reset() deletes all particle systems immediately, but DrawModules
795-
// (W3DTruckDraw, W3DTankDraw, etc.) hold raw pointers to particle systems. When those
796-
// DrawModules are later destroyed during game shutdown, they crash accessing freed memory.
797-
// update() only cleans up finished particle systems, leaving active ones intact.
786+
// TheSuperHackers @info helmutbuhler 03/05/2025 bobtista 02/02/2026
787+
// Update particles to prevent accumulation in headless mode. update() has slightly more
788+
// CPU overhead than reset() but is semantically correct - particles finish naturally.
798789
TheParticleSystemManager->update();
799790
}
800791

0 commit comments

Comments
 (0)