From 9497941ef63e3419a96d538702ea82d52948d646 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 2 May 2023 18:14:17 +0100 Subject: [PATCH] P_DoAllPlayersExit: Play finish sounds on successful execution - If a local player is already finished, don't play any sound - If the local players finish as a result of this, play the race finish line cross sound - Else, play the race opponent finish line cross sound --- src/p_user.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index f6470d464..7df83c627 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1376,6 +1376,7 @@ void P_DoAllPlayersExit(pflags_t flags, boolean trygivelife) { UINT8 i; boolean givenlife = false; + const boolean dofinishsound = (musiccountdown == 0); for (i = 0; i < MAXPLAYERS; i++) { @@ -1399,6 +1400,22 @@ void P_DoAllPlayersExit(pflags_t flags, boolean trygivelife) givenlife = true; } + if (!dofinishsound) + { + // You've already finished, don't play again + ; + } + else if (musiccountdown == 0) + { + // Other people finish + S_StartSound(NULL, sfx_s253); + } + else if (musiccountdown > 1) + { + // Everyone finish sound + S_StartSound(NULL, sfx_s3k6a); + } + if (givenlife) { // Life sound