From e2b06aa6003641f032883315d5b185bfa757bce7 Mon Sep 17 00:00:00 2001 From: alufolie91 Date: Wed, 30 Aug 2023 17:08:50 +0200 Subject: [PATCH] Ghost and signpost support https://git.do.srb2.org/haya_/Kart-Public/-/commit/f07179589414b15605da14901f742342ab53de66 --- src/p_user.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 700671ef6..5130c8f55 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1696,6 +1696,8 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj) ghost->fuse = ghost->info->damage; ghost->skin = mobj->skin; + ghost->localskin = mobj->localskin; + ghost->skinlocal = mobj->skinlocal; if (mobj->flags2 & MF2_OBJECTFLIP) ghost->flags |= MF2_OBJECTFLIP; @@ -1737,10 +1739,19 @@ void P_DoPlayerExit(player_t *player) if (P_IsLocalPlayer(player)) { sfxenum_t sfx_id; - if (K_IsPlayerLosing(player)) - sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_klose].skinsound]; - else - sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_kwin].skinsound]; + // fix godjjsa win sounds + if (K_IsPlayerLosing(player)) { + if (player->mo->skinlocal) + sfx_id = ((skin_t *)player->mo->localskin)->soundsid[S_sfx[sfx_klose].skinsound]; + else + sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_klose].skinsound]; + } + else { + if (player->mo->skinlocal) + sfx_id = ((skin_t *)player->mo->localskin)->soundsid[S_sfx[sfx_kwin].skinsound]; + else + sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_kwin].skinsound]; + } S_StartSound(NULL, sfx_id); } else