mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
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:
@@ -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() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user