From: Holger Schemel Date: Tue, 13 Feb 2024 20:24:29 +0000 (+0100) Subject: added fallback from random to default BD style diamond impact sound X-Git-Tag: 4.4.0.0-test-1~367 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=bbe2d057fa5fb7fe2eb5e0d96079ad850ab4d3b3;p=rocksndiamonds.git added fallback from random to default BD style diamond impact sound --- diff --git a/src/game.c b/src/game.c index 47f36117..d6ff2454 100644 --- a/src/game.c +++ b/src/game.c @@ -15668,6 +15668,9 @@ static int getSoundEffect_BD(int element_bd, int sample) case GD_S_DIAMOND_RANDOM: nr = GetSimpleRandom(8); sound_effect = SND_BD_DIAMOND_IMPACT_RANDOM_1 + nr; + + if (getSoundInfoEntryFilename(sound_effect) == NULL) + sound_effect = SND_BD_DIAMOND_IMPACT; break; case GD_S_DIAMOND_1: @@ -15680,6 +15683,9 @@ static int getSoundEffect_BD(int element_bd, int sample) case GD_S_DIAMOND_8: nr = sample - GD_S_DIAMOND_1; sound_effect = SND_BD_DIAMOND_IMPACT_RANDOM_1 + nr; + + if (getSoundInfoEntryFilename(sound_effect) == NULL) + sound_effect = SND_BD_DIAMOND_IMPACT; break; case GD_S_TIMEOUT_0: