Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(gameengine): silence infantry death voices behind the main menu

Olcay Seyganfae2dedb6080
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 380e63c21..75d06768c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -735,6 +735,7 @@ A third pass went through the generals' powers, promotions and unit abilities.
## Twenty-two-year-old bugs, found by testing
- Pressing Continue after a campaign mission goes straight to the next one. The main menu used to wake up behind the score screen on the way out, show its buttons and start loading its own background battle, so the menu sat on screen over the next mission's load.
+- The main menu no longer opens with a man screaming. The battleship in the battle behind the menu shells GLA infantry, and each of them died out loud, the first one eight frames in. The guns, the explosions and the jungle still play.
- A civilian car no longer drives into your base in the first minute of every game. A map's civilians are owned by a computer player like any other, and the scouting pass looks for anything of that player's that can drive - so it was picking a parked car out of the scenery and sending it to a start position. A side with no faction and no build list has nothing to learn from the map and does not scout.
- A rifleman pulled off an oil derrick mid-capture left it flashing and chiming for the rest of the match, and the derrick changed hands anyway with nobody standing on it. Walking away now stops the capture, whether you or the computer gave the order.
- Every countdown on screen was a second too long. Rounding up a whole number of seconds gave a whole number plus one, so a ten second build said eleven - production queues, buildings going up, superweapons, all of it.
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp
index 25008a8d4..ecb903187 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/Audio/GameAudio.cpp
@@ -408,6 +408,11 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd)
return AHSV_NoSound;
}
+ // The battle behind the main menu kills infantry, and their death cries are not menu sound.
+ if (eventToAdd->getEventName().endsWith("VoiceDie") && TheGameLogic->isInShellGame()) {
+ return AHSV_NoSound;
+ }
+
#ifdef INTENSIVE_AUDIO_DEBUG
DEBUG_LOG(("AUDIO (%d): Received addAudioEvent('%s')", TheGameLogic->getFrame(), eventToAdd->getEventName().str()));
#endif
@@ -473,7 +478,7 @@ AudioHandle AudioManager::addAudioEvent(const AudioEventRTS *eventToAdd)
}
AudioType type = eventToAdd->getAudioEventInfo()->m_soundType;
- if (type == AT_Music)
+ if (type == AT_Music)
{
m_music->addAudioEvent(audioEvent);
}