diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index a72c46da8..729326272 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1676,11 +1676,13 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int if (p->poszv > 2400 && p->falling_counter < 255) { p->falling_counter++; - if (p->falling_counter == 38) - p->scream_voice = S_PlayActorSound(DUKE_SCREAM, pi); + if (p->falling_counter == 38 && !S_CheckActorSoundPlaying(pi, DUKE_SCREAM)) + S_PlayActorSound(DUKE_SCREAM, pi); } if ((p->posz + p->poszv) >= (fz - (i << 8))) // hit the ground + { + S_StopSound(DUKE_SCREAM, pi); if (sector[p->cursectnum].lotag != 1) { if (p->falling_counter > 62) quickkill(p); @@ -1704,6 +1706,7 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int } else if (p->poszv > 2048) S_PlayActorSound(DUKE_LAND, pi); } + } } } diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 13a875415..f8eab04cd 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -2176,15 +2176,17 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int if (p->poszv > 2400 && p->falling_counter < 255) { p->falling_counter++; - if (p->falling_counter == 38) - p->scream_voice = S_PlayActorSound(DUKE_SCREAM, pi); + if (p->falling_counter == 38 && !S_CheckActorSoundPlaying(pi, DUKE_SCREAM)) + S_PlayActorSound(DUKE_SCREAM, pi); } if ((p->posz + p->poszv) >= (fz - (i << 8))) // hit the ground + { + S_StopSound(DUKE_SCREAM, pi); if (sector[p->cursectnum].lotag != 1) { if (isRRRA()) p->MotoOnGround = 1; - if (p->falling_counter > 62 || (isRRRA() && p->falling_counter > 2 && sector[p->cursectnum].lotag == 802)) + if (p->falling_counter > 62 || (isRRRA() && p->falling_counter > 2 && sector[p->cursectnum].lotag == 802)) quickkill(p); else if (p->falling_counter > 9) @@ -2220,6 +2222,7 @@ static void movement(int snum, ESyncBits sb_snum, int psect, int fz, int cz, int p->TurbCount = 12; } } + } } } diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index e150af7e9..86bae4d6f 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -208,7 +208,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w, ("last_full_weapon", w.last_full_weapon) ("footprintshade", w.footprintshade) ("boot_amount", w.boot_amount) - ("scream_voice", w.scream_voice) ("gm", w.gm) ("on_warping_sector", w.on_warping_sector) ("footprintcount", w.footprintcount) diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index dd5e9e386..559d277ea 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -160,8 +160,6 @@ struct player_struct short holoduke_on, pycount, frag_ps; short transporter_hold, last_full_weapon, footprintshade, boot_amount; - int scream_voice; - unsigned char gm; unsigned char on_warping_sector, footprintcount; unsigned char hbomb_on, jumping_toggle, rapid_fire_hold, on_ground;