mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
[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 🆑 fix: The mafia early vote counter will now properly display. /🆑 * [NO GBP] Mafia fixes for some of my mafia mistakes --------- Co-authored-by: Rhials <Datguy33456@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user