Fix music playing when crepitus is present (#341)

UseCreatureMusic( HostileZombiesPresent() ); was overriding the music mode set in PrepareCreaturesForBattle() when encountering crepitus or being in the creature caves, resulting in regular tense and battle music being played.
This commit is contained in:
Asdow
2024-12-02 01:10:58 +02:00
committed by GitHub
parent 1cd94cda23
commit 11bb0f741f
7 changed files with 73 additions and 49 deletions
+23
View File
@@ -3259,3 +3259,26 @@ FLOAT GetCorpseRotFactor( ROTTING_CORPSE* pCorpse )
return (FLOAT)(min(gGameExternalOptions.usCorpseDelayUntilRotting, GetWorldTotalMin() - pCorpse->def.uiTimeOfDeath)) / gGameExternalOptions.usCorpseDelayUntilRotting;
}
void CheckForZombieMusic()
{
extern UINT8 LightGetColors( SGPPaletteEntry * pPal );
if ( gGameSettings.fOptions[TOPTION_ZOMBIES] )
{
SGPPaletteEntry LColors[3];
LightGetColors( LColors );
// If we're underground in the creature caves, use creepy music based on the cave light colors.
// Without this, the crepitus cave music is not working correctly as these checks override the original musicmode choice
// See PrepareCreaturesForBattle() in Creature Spreading.cpp
if ( gbWorldSectorZ )
{
UseCreatureMusic( LColors->peBlue || HostileZombiesPresent() );
}
else
{
UseCreatureMusic( HostileZombiesPresent() );
}
}
}