From 95e847f2a39128944911d7da2645a69ba7898cb0 Mon Sep 17 00:00:00 2001 From: LeonardoTheMutant <70893504+LeonardoTheMutant@users.noreply.github.com> Date: Sun, 10 Nov 2024 00:45:01 +0100 Subject: [PATCH] Fix 2 "softlocks" - Fixed a softlock, that was caused by the automatic Emerald Camping kick system (In a game where 1 Innocent and 1 Murderer are alive, when Murderer is kicked the game does not end) - The override rule for the Suspence music now works only during the level state (GS_LEVEL) --- SRC/LUA/FUNCTIONS.LUA | 2 +- SRC/LUA/GAME.LUA | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SRC/LUA/FUNCTIONS.LUA b/SRC/LUA/FUNCTIONS.LUA index 52b5961..cb03d6a 100644 --- a/SRC/LUA/FUNCTIONS.LUA +++ b/SRC/LUA/FUNCTIONS.LUA @@ -278,7 +278,7 @@ end) rawset(_G, "MM_PlayerQuit", function(p) if (p.role == ROLE_MURDERER) p.role = ROLE_NONE - if ((not PlayerCount(ROLE_INNOCENT)) and (not PlayerCount(ROLE_MURDERER))) + if ((not PlayerCount(ROLE_INNOCENT)) and (not PlayerCount(ROLE_MURDERER))) or ((PlayerCount(ROLE_INNOCENT) == 1) and (not PlayerCount(ROLE_SHERIFF)) and (not PlayerCount(ROLE_HERO)) and (not PlayerCount(ROLE_MURDERER))) MM_EndRound(0, "LAST_LEFT", ROLE_MURDERER) elseif (PlayerCount(ROLE_INNOCENT) and (not PlayerCount(ROLE_MURDERER))) MM_ChatprintGlobal("REPLACE_LEFT", ROLE_MURDERER) diff --git a/SRC/LUA/GAME.LUA b/SRC/LUA/GAME.LUA index c6ecb4f..973102d 100644 --- a/SRC/LUA/GAME.LUA +++ b/SRC/LUA/GAME.LUA @@ -452,11 +452,12 @@ end) -- addHook("MusicChange", function(old, new) if (gametype != GT_LTMMURDERMYSTERY) return end - + --Showdown Duel music if ((gamestate == GS_LEVEL) and (MM.shwdwn) and (leveltime) and not (consoleplayer.powers[pw_underwater] or consoleplayer.powers[pw_spacetime])) return MM.shwdwn end - if ((old == "SUSNCE") and (leveltime) and not (consoleplayer.powers[pw_underwater] or consoleplayer.powers[pw_spacetime])) return "SUSNCE" end + --Suspence music + if ((gamestate == GS_LEVEL) and (old == "SUSNCE") and (leveltime) and not (consoleplayer.powers[pw_underwater] or consoleplayer.powers[pw_spacetime])) return "SUSNCE" end --Intermission theme if (new == "_inter")