Skip to content

bugfix(audio): Fix particle cannon being inaudible after saveload#2302

Open
stephanmeesters wants to merge 1 commit intoTheSuperHackers:mainfrom
stephanmeesters:bigfix-particlecannon-audio
Open

bugfix(audio): Fix particle cannon being inaudible after saveload#2302
stephanmeesters wants to merge 1 commit intoTheSuperHackers:mainfrom
stephanmeesters:bigfix-particlecannon-audio

Conversation

@stephanmeesters
Copy link

@stephanmeesters stephanmeesters commented Feb 13, 2026

Fixes issue where sound from the particle cannon is not audible after saveload.

A savegame can be made during any of combinations of STATUS_ and LASERSTATUS_ below. Sounds are triggered only during state change, so when loading a savegame any of the sounds in the Active column need to be added.

Cycle sequence of beam firing vs sounds

STATUS_ LASERSTATUS_ Add Clear Active
PACKING (1) NONE none none none
CHARGING NONE powerupSound unpackToReadySound
firingToIdleSound
annihilationSound
powerupSound
PREPARING NONE unpackToReadySound firingToIdleSound
annihilationSound
powerupSound
unpackToReadySound
ALMOST_READY NONE none none powerupSound
unpackToReadySound
READY_TO_FIRE NONE none powerupSound
firingToIdleSound
annihilationSound
unpackToReadySound
PREFIRE NONE none none unpackToReadySound
FIRING BORN firingToIdleSound
annihilationSound
powerupSound
unpackToReadySound
firingToIdleSound
annihilationSound
POSTFIRE BORN none none firingToIdleSound
annihilationSound
PACKING (2) DECAYING
DEAD
none none firingToIdleSound
annihilationSound
IDLE NONE none powerupSound
unpackToReadySound
firingToIdleSound
annihilationSound
none

Status meanings

  • IDLE: Particle cannon is inactive and fully reset.
  • CHARGING: Early pre-ready phase; charging loop plays.
  • PREPARING: Antenna/deploy preparation phase.
  • ALMOST_READY: Near-ready phase before final ready state.
  • READY_TO_FIRE: Weapon is available and waiting for fire command.
  • PREFIRE: Transitional pre-shot state (defined and checked, typically brief/rare in this flow).
  • FIRING: Main active attack phase while beam is operating.
  • POSTFIRE: Attack is decaying after firing window ends.
  • PACKING: Pack-up phase after attack/ready path.

Laser status meanings

  • NONE: No orbital beam lifecycle started yet for current cycle.
  • BORN: Orbit-to-target beam was created and is in active phase.
  • DECAYING: Beam is in decay/shutdown window.
  • DEAD: Beam lifecycle is finished (end state before reset to NONE on next cycle setup).

Sound meanings

  • powerupSound: charge, at particle cannon.
  • unpackToReadySound: prep, at particle cannon.
  • firingToIdleSound: firing/pack, at particle cannon.
  • annihilationSound: beam-impact, at origin beam.

Todo

  • Replicate to Generals

@greptile-apps
Copy link

greptile-apps bot commented Feb 13, 2026

Greptile Overview

Greptile Summary

Restores particle cannon audio after save/load by re-registering sound handles in loadPostProcess() when the cannon is in STATUS_FIRING, STATUS_POSTFIRE, or STATUS_PACKING states.

  • Adds sound handle restoration for m_firingToIdleSound (cannon sound) and m_annihilationSound (beam sound)
  • Mirrors the existing pattern used in setLogicalStatus() at ParticleUplinkCannonUpdate.cpp:1239-1242 and createOrbitToTargetLaser() at ParticleUplinkCannonUpdate.cpp:1052-1056
  • Properly checks conditions before registering: sound event name must be non-empty, and for beam sound, beam drawable must exist

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix follows established patterns from the same codebase, properly checks preconditions, addresses a specific bug with clear reproduction steps, and only affects save/load behavior without changing runtime logic
  • No files require special attention

Important Files Changed

Filename Overview
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp Restores audio events for particle cannon sounds after save/load by re-registering sound handles in loadPostProcess() when cannon is firing

Last reviewed commit: 7d22e2e

}
}

// TheSuperHackers @info stephanmeesters 13/02/2026
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bugfix


// TheSuperHackers @info stephanmeesters 13/02/2026
// Fix issue where sound from the particle cannon is not audible after saveload
if( m_status == STATUS_FIRING || m_status == STATUS_POSTFIRE || m_status == STATUS_PACKING )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why POSTFIRE and PACKING ?

Can you explain how the statuses relate to the lifetime of the 2 sounds?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Particle Cannon Sound is not audible after saveload

2 participants