Skip to content

Commit 8cce6f6

Browse files
bugfix(audio): Fix particle cannon being inaudible after saveload (#2302)
1 parent 37fb2a6 commit 8cce6f6

2 files changed

Lines changed: 64 additions & 1 deletion

File tree

Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,38 @@ void ParticleUplinkCannonUpdate::loadPostProcess()
14641464
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
14651465
}
14661466
}
1467+
1468+
// TheSuperHackers @bugfix stephanmeesters 13/02/2026
1469+
// For retail game compatibility, this fixes an issue where particle cannon sounds are not audible after saveload.
1470+
if( (m_status == STATUS_CHARGING || m_status == STATUS_PREPARING || m_status == STATUS_ALMOST_READY) &&
1471+
m_powerupSound.getEventName().isNotEmpty() )
1472+
{
1473+
m_powerupSound.setObjectID( getObject()->getID() );
1474+
m_powerupSound.setPlayingHandle( TheAudio->addAudioEvent( &m_powerupSound ) );
1475+
}
1476+
1477+
if( (m_status == STATUS_PREPARING || m_status == STATUS_ALMOST_READY || m_status == STATUS_READY_TO_FIRE || m_status == STATUS_PREFIRE) &&
1478+
m_unpackToReadySound.getEventName().isNotEmpty() )
1479+
{
1480+
m_unpackToReadySound.setObjectID( getObject()->getID() );
1481+
m_unpackToReadySound.setPlayingHandle( TheAudio->addAudioEvent( &m_unpackToReadySound ) );
1482+
}
1483+
1484+
if( m_status == STATUS_FIRING || m_status == STATUS_POSTFIRE ||
1485+
(m_status == STATUS_PACKING && (m_laserStatus == LASERSTATUS_DECAYING || m_laserStatus == LASERSTATUS_DEAD)) )
1486+
{
1487+
if( m_firingToIdleSound.getEventName().isNotEmpty() )
1488+
{
1489+
m_firingToIdleSound.setObjectID( getObject()->getID() );
1490+
m_firingToIdleSound.setPlayingHandle( TheAudio->addAudioEvent( &m_firingToIdleSound ) );
1491+
}
1492+
1493+
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID && m_annihilationSound.getEventName().isNotEmpty() )
1494+
{
1495+
m_annihilationSound.setDrawableID( m_orbitToTargetBeamID );
1496+
m_annihilationSound.setPlayingHandle( TheAudio->addAudioEvent( &m_annihilationSound ) );
1497+
}
1498+
}
14671499
}
14681500

14691501
}

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,37 @@ void ParticleUplinkCannonUpdate::loadPostProcess()
15571557
DEBUG_CRASH(( "ParticleUplinkCannonUpdate::loadPostProcess - Unable to find drawable for m_orbitToTargetBeamID" ));
15581558
}
15591559
}
1560-
}
15611560

1561+
// TheSuperHackers @bugfix stephanmeesters 13/02/2026
1562+
// For retail game compatibility, this fixes an issue where particle cannon sounds are not audible after saveload.
1563+
if( (m_status == STATUS_CHARGING || m_status == STATUS_PREPARING || m_status == STATUS_ALMOST_READY) &&
1564+
m_powerupSound.getEventName().isNotEmpty() )
1565+
{
1566+
m_powerupSound.setObjectID( getObject()->getID() );
1567+
m_powerupSound.setPlayingHandle( TheAudio->addAudioEvent( &m_powerupSound ) );
1568+
}
1569+
1570+
if( (m_status == STATUS_PREPARING || m_status == STATUS_ALMOST_READY || m_status == STATUS_READY_TO_FIRE || m_status == STATUS_PREFIRE) &&
1571+
m_unpackToReadySound.getEventName().isNotEmpty() )
1572+
{
1573+
m_unpackToReadySound.setObjectID( getObject()->getID() );
1574+
m_unpackToReadySound.setPlayingHandle( TheAudio->addAudioEvent( &m_unpackToReadySound ) );
1575+
}
1576+
1577+
if( m_status == STATUS_FIRING || m_status == STATUS_POSTFIRE ||
1578+
(m_status == STATUS_PACKING && (m_laserStatus == LASERSTATUS_DECAYING || m_laserStatus == LASERSTATUS_DEAD)) )
1579+
{
1580+
if( m_firingToIdleSound.getEventName().isNotEmpty() )
1581+
{
1582+
m_firingToIdleSound.setObjectID( getObject()->getID() );
1583+
m_firingToIdleSound.setPlayingHandle( TheAudio->addAudioEvent( &m_firingToIdleSound ) );
1584+
}
1585+
1586+
if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID && m_annihilationSound.getEventName().isNotEmpty() )
1587+
{
1588+
m_annihilationSound.setDrawableID( m_orbitToTargetBeamID );
1589+
m_annihilationSound.setPlayingHandle( TheAudio->addAudioEvent( &m_annihilationSound ) );
1590+
}
1591+
}
1592+
}
15621593
}

0 commit comments

Comments
 (0)