From 105770c4eae5974664ee5d0daaef168a571a977b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 24 Apr 2023 02:43:02 +0100 Subject: [PATCH] [MIRROR] [NO GBP] Mafia fixes for some of my mafia mistakes [MDB IGNORE] (#20721) * [NO GBP] Mafia fixes for some of my mafia mistakes (#74930) ## About The Pull Request This fixes two issues with previous changes I've made to mafia workings. The first makes the early start vote counter list properly. I misunderstood what the FLOOR() macro did so the result would just put out 0. The early start vote counter now displays the higher value of either (players signed up / 2) or (minimum players / 2). Since the minimum playercount is 6, the it will display X/3 unless there are more than 6 players signed up. The second change makes sure that check_start_votes() checks the mafia signup list (as opposed to the early signup votes) to see if there are enough players to start a game. ## Why It's Good For The Game Fixes stupid things that I let slip in under the door. ## Changelog :cl: fix: The mafia early vote counter will now properly display. /:cl: * [NO GBP] Mafia fixes for some of my mafia mistakes --------- Co-authored-by: Rhials --- code/modules/mafia/controller.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mafia/controller.dm b/code/modules/mafia/controller.dm index 35ef17a6ea6..aeb4d85b588 100644 --- a/code/modules/mafia/controller.dm +++ b/code/modules/mafia/controller.dm @@ -786,7 +786,7 @@ GLOBAL_LIST_INIT(mafia_role_by_alignment, setup_mafia_role_by_alignment()) to_chat(usr, span_notice("You are no longer voting to start the game early.")) else GLOB.mafia_early_votes[C.ckey] = C - to_chat(usr, span_notice("You vote to start the game early ([length(GLOB.mafia_early_votes)] out of [FLOOR(round(length(GLOB.mafia_signup) / 2), MAFIA_MIN_PLAYER_COUNT)]).")) + to_chat(usr, span_notice("You vote to start the game early ([length(GLOB.mafia_early_votes)] out of [max(round(length(GLOB.mafia_signup) / 2), round(MAFIA_MIN_PLAYER_COUNT / 2))]).")) if(check_start_votes()) //See if we have enough votes to start forced_setup() return TRUE @@ -935,8 +935,8 @@ GLOBAL_LIST_INIT(mafia_role_by_alignment, setup_mafia_role_by_alignment()) /datum/mafia_controller/proc/check_start_votes() check_signups() //Same as before. What a useful proc. - if(length(GLOB.mafia_early_votes) < MAFIA_MIN_PLAYER_COUNT) - return FALSE //Bare minimum is 3, otherwise the game instantly ends. Also prevents people from randomly starting games for no reason. + if(length(GLOB.mafia_signup) < MAFIA_MIN_PLAYER_COUNT) + return FALSE //Make sure we have the minimum playercount to host a game first. if(length(GLOB.mafia_early_votes) < round(length(GLOB.mafia_signup) / 2)) return FALSE