Skip to content

Commit

Permalink
Fix 2 "softlocks"
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
LeonardoTheMutant committed Nov 9, 2024
1 parent 676e78a commit 95e847f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SRC/LUA/FUNCTIONS.LUA
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions SRC/LUA/GAME.LUA
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 95e847f

Please sign in to comment.