diff --git a/source/sw/src/ai.cpp b/source/sw/src/ai.cpp index 852ba9601..0139c783b 100644 --- a/source/sw/src/ai.cpp +++ b/source/sw/src/ai.cpp @@ -258,7 +258,7 @@ DoActorNoise(ANIMATORp Action, short SpriteNum) PlaySpriteSound(SpriteNum, attr_attack, v3df_follow); // MONO_PRINT("Attack Sound"); } - if (Action == InitActorPainNoise) + else if (Action == InitActorPainNoise) { PlaySpriteSound(SpriteNum, attr_pain, v3df_follow); // MONO_PRINT("Pain Sound"); @@ -280,15 +280,15 @@ DoActorNoise(ANIMATORp Action, short SpriteNum) { PlaySpriteSound(SpriteNum, attr_extra3, v3df_follow); } - if (Action == InitActorExtra4Noise) + else if (Action == InitActorExtra4Noise) { PlaySpriteSound(SpriteNum, attr_extra4, v3df_follow); } - if (Action == InitActorExtra5Noise) + else if (Action == InitActorExtra5Noise) { PlaySpriteSound(SpriteNum, attr_extra5, v3df_follow); } - if (Action == InitActorExtra6Noise) + else if (Action == InitActorExtra6Noise) { PlaySpriteSound(SpriteNum, attr_extra6, v3df_follow); } diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index bd0cc7144..3e69aed53 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -1018,14 +1018,14 @@ InitLevel(void) // A few IMPORTANT GLOBAL RESETS InitLevelGlobals(); - if (!DemoMode) - Mus_Stop(); - if (LoadGameOutsideMoveLoop) { return; } + if (!DemoMode) + Mus_Stop(); + InitLevelGlobals2(); if (DemoMode) { @@ -1359,8 +1359,12 @@ void NewLevel(void) } else { - InitLevel(); - RunLevel(); + do + { + InitLevel(); + RunLevel(); + } + while (LoadGameOutsideMoveLoop); STAT_Update(false); if (!QuitFlag) @@ -2629,6 +2633,10 @@ void RunLevel(void) OSD_DispatchQueued(); D_ProcessEvents(); faketimerhandler(); + if (LoadGameOutsideMoveLoop) + { + return; + } if (M_Active()) { diff --git a/source/sw/src/game.h b/source/sw/src/game.h index ca2d9df26..4dcd136ea 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -2096,6 +2096,7 @@ int _PlaySound(int num, SPRITEp sprite, PLAYERp player, vec3_t *pos, Voc3D_Flags void InitAmbient(int num, SPRITEp sprite); inline void PlaySound(int num, SPRITEp sprite, Voc3D_Flags flags, int channel = 8) { + assert(num != DIGI_NINJAPAIN); _PlaySound(num, sprite, nullptr, nullptr, flags, channel); } inline void PlaySound(int num, PLAYERp player, Voc3D_Flags flags, int channel = 8)