From 182768aa32cbd7d7709aee815b74e43d6f6f93eb Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 25 Feb 2023 00:33:56 +0000 Subject: [PATCH] Unlockable sounds updated - Use sfx_achiev when any Challenge is completed - If picking up MT_EMBLEM *doesn't* immediately complete a challenge, use sfx_ncitem as before - Bugfix: this sound is played even when online, which it wasn't previously doing (because the object couldn't be destroyed and play its sound) --- src/info.c | 2 +- src/m_cond.c | 2 +- src/p_inter.c | 3 ++- src/sounds.c | 1 + src/sounds.h | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/info.c b/src/info.c index 2c22b4bf4..4807869e6 100644 --- a/src/info.c +++ b/src/info.c @@ -8037,7 +8037,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // missilestate S_SPRK1, // deathstate S_NULL, // xdeathstate - sfx_ncitem, // deathsound + sfx_None, // deathsound 1, // speed 16*FRACUNIT, // radius 30*FRACUNIT, // height diff --git a/src/m_cond.c b/src/m_cond.c index f948f400d..070c5b9ea 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -912,7 +912,7 @@ boolean M_UpdateUnlockablesAndExtraEmblems(boolean loud) { if (loud) { - S_StartSound(NULL, sfx_ncitem); + S_StartSound(NULL, sfx_achiev); } return true; } diff --git a/src/p_inter.c b/src/p_inter.c index 64f96100a..25ddaa59b 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -552,7 +552,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (P_IsLocalPlayer(player) && !gamedata->collected[special->health-1]) { gamedata->collected[special->health-1] = gotcollected = true; - M_UpdateUnlockablesAndExtraEmblems(true); + if (!M_UpdateUnlockablesAndExtraEmblems(true)) + S_StartSound(NULL, sfx_ncitem); G_SaveGameData(); } diff --git a/src/sounds.c b/src/sounds.c index 207d2713c..0fc59206a 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1101,6 +1101,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"typri1", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 boss typewriting 1 {"typri2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SA2 final boss-type typewriting {"eggspr", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Sonic Unleashed Trap Spring + {"achiev", false, 204, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Achievement"}, // SRB2Kart - Drop target sounds {"kdtrg1", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Low energy, SF_X8AWAYSOUND diff --git a/src/sounds.h b/src/sounds.h index b6f910c6f..46f1eedf8 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1168,6 +1168,7 @@ typedef enum sfx_typri1, sfx_typri2, sfx_eggspr, + sfx_achiev, // SRB2Kart - Drop target sounds sfx_kdtrg1,