Repository navigation
bugfix(particlesys): Load particle system under control in Particle::loadPostProcess() - #3579
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Store the controlled-system transfer ID Core/GameEngine/Include/GameClient/ParticleSys.h, Core/GameEngine/Source/GameClient/System/ParticleSys.cpp |
Particle now tracks whether the union contains a transfer ID or runtime pointer. Serialization saves an ID only when the controlled system exists, is not destroyed, and is saveable. Loading defers pointer resolution, and the destructor skips cleanup while restoration is pending. |
Restore the controlled particle system Core/GameEngine/Source/GameClient/System/ParticleSys.cpp |
Post-processing resolves and clears the deferred ID. It throws SC_INVALID_DATA if the system is missing. Otherwise, it links the particle to the system. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: bobtista
Merge Risk: 
Minimal · up to 10391
-
Controlled-system references omitted from saves no longer trigger the identified load failure. The change is mergeable after normal checks.
Pre-merge checks: 
4
-
Full details: Linked Issues check
-
Explanation
Issue
#842requires the particle-system ID to resolve duringParticle::loadPostProcess()and requires safe handling when the lookup fails.Particle::xfer()now stores the loaded ID inm_xferSystemUnderControlID.loadPostProcess()callsfindParticleSystem(), checks fornullptrbefore use, throwsSC_INVALID_DATAwhen needed, and restoresm_systemUnderControlfor a valid system. The transfer tag also prevents the destructor from treating transfer data as a runtime pointer. Issue#842has no stated automated-test requirement.
Full details: Out of Scope Changes check
-
Explanation
The changes are limited to the controlled particle-system transfer state, serialization, post-load restoration, and destructor safety. The saveability checks and transfer tag support the particle-system reference fix and interrupted-load safety described by the PR and issue
#842. No unrelated change is shown.
Full details: Title check
-
Explanation
The title names the primary change: Particle::loadPostProcess() now loads the particle system under control. The raw summary confirms this. The loadPostProcess path looks up the saved ID, throws SC_INVALID_DATA when no system is found, and links the control particle. The title does not mention the rename to m_xferSystemUnderControlID, the new transfer flag, or the destructor change. Those details are secondary and need not appear in the title.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
[Medium impact] The PR appears safe to merge; no actionable issues were found.
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a17d8048-1120-44e3-82fc-a77ea203aaed
📒 Files selected for processing: 2
Core/GameEngine/Include/GameClient/ParticleSys.hCore/GameEngine/Source/GameClient/System/ParticleSys.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
|
I think it looks good, but some concerns about legacy saves now more often leading to |
23a6e13 to
1039118
Compare
xezon
left a comment
There was a problem hiding this comment.
Looks technically right. Style can be polished.
1039118 to
cb6f3f3
Compare
564903c to
6aac629
Compare
I made some non-style changes since your review, so you may want to give it another good look. There's some redundancy in the code (writing to both union members), but I tried to make sure that changing the |
6aac629 to
9e4e0dd
Compare
The conversion from from
ParticleSystem*toParticleSystemIDand back is currently bugged during theParticlexfer process.ParticleSystemID m_systemUnderControlIDis never set, so the lookup inParticle::loadPostProcessnever succeeds. This PR fixes that.GeneralsGameCode/Core/GameEngine/Include/GameClient/ParticleSys.h
Lines 252 to 256 in f02fcd3
I added a union tag to keep track which union member is currently active to keep the behavior well-defined. I also did assignments to both union members just to be sure. This way removing the union / changing the pointer to 64 bit should not introduce new issues.