You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes a regression introduced in #2220 where the Particle Cannon's positional audio became quieter because the audio source was being implicitly anchored to the visual beam drawable's transform (which points from orbit down to the ground, placing the audio source far from the player's camera). The fix explicitly calls beam->setPosition() with a Coord3D 500 units above the ground-impact target in both the per-frame update() path and the one-time createOrbitToTargetLaser() initialization path, decoupling the audio spawn point from the visual laser endpoints managed by LaserUpdate::initLaser.
Changes are applied symmetrically to both Generals/ (vanilla) and GeneralsMD/ (Zero Hour) builds with correct product name headers and GPL licenses. The fix is applied at two call sites per file: update() (runs every frame, follows m_currentTargetPosition as the beam sweeps) and createOrbitToTargetLaser() (initial beam creation, uses m_initialTargetPosition). Both are necessary for correct audio positioning throughout the weapon's lifetime.
LaserUpdate::initLaser uses explicit world-space endpoint coordinates independent of the drawable's own transform, so calling setPosition afterward does not affect the visual rendering — only the audio source location.
Confidence Score: 4/5
Safe to merge; the fix is targeted, logically sound, and carries no risk of visual or gameplay regression.
The change is minimal (4 lines × 2 sites × 2 files), follows established patterns in the codebase, and correctly targets only the drawable position used by the audio system without disturbing LaserUpdate's world-space visual endpoints. No correctness or safety issues identified.
No files require special attention.
Sequence Diagram
sequenceDiagram
participant Logic as ParticleUplinkCannonUpdate
participant GC as TheGameClient
participant Beam as Drawable (beam)
participant LU as LaserUpdate
participant Audio as TheAudio
Note over Logic: createOrbitToTargetLaser()
Logic->>GC: newDrawable(thingTemplate)
GC-->>Beam: beam created
Logic->>Beam: findClientUpdateModule("LaserUpdate")
Beam-->>LU: update module
Logic->>LU: initLaser(orbitPosition → initialTargetPosition)
Note over LU: Sets visual endpoints (world-space absolute)
Logic->>Beam: setPosition(initialTargetPosition + z500)
Note over Beam: Audio anchor = ground target + 500 units
Logic->>Audio: addAudioEvent(annihilationSound @ drawableID)
Note over Logic: update() — every frame
Logic->>GC: findDrawableByID(m_orbitToTargetBeamID)
GC-->>Beam: existing beam
Logic->>LU: initLaser(orbitPosition → currentTargetPosition)
Note over LU: Updates visual endpoints each frame
Logic->>Beam: setPosition(currentTargetPosition + z500)
Note over Beam: Audio follows swept target position
The reason will be displayed to describe this comment to others. Learn more.
I suggest put this near ORBITAL_BEAM_Z_OFFSET as
// TheSuperHackers @fix The positional audio is now decoupled from the beam origin.
// 500 units represent the height of the original audio emitter.
constexpr const Real ORBITAL_BEAM_AUDIO_Z_OFFSET = 500.0f;
xezon
added
Audio
Is audio related
Bug
Something is not working right, typically is user facing
Major
Severity: Minor < Major < Critical < Blocker
ThisProject
The issue was introduced by this project, or this task is specific to this project
labels
Mar 7, 2026
xezon
changed the title
fix(audio): Decouple Particle Cannon audio spawn point from visual beam
bugfix(audio): Decouple Particle Cannon audio spawn point from visual beam
Mar 7, 2026
xezon
changed the title
bugfix(audio): Decouple Particle Cannon audio spawn point from visual beam
bugfix(audio): Decouple Particle Cannon audio spawn point from visual beam to restore correct position and fix quiet beam audio
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AudioIs audio relatedBugSomething is not working right, typically is user facingMajorSeverity: Minor < Major < Critical < BlockerThisProjectThe issue was introduced by this project, or this task is specific to this project
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for the Particle Cannon being quieter