Added a config to disallow unreadied players from voting on modes/storytellers

This commit is contained in:
Putnam
2021-02-08 22:59:49 -08:00
parent 936abbd9f0
commit 7a6ed7f500
2 changed files with 14 additions and 0 deletions

View File

@@ -484,6 +484,8 @@
/datum/config_entry/flag/modetier_voting /datum/config_entry/flag/modetier_voting
/datum/config_entry/flag/must_be_readied_to_vote_gamemode
/datum/config_entry/number/dropped_modes /datum/config_entry/number/dropped_modes
config_entry_value = 3 config_entry_value = 3

View File

@@ -68,6 +68,10 @@ SUBSYSTEM_DEF(vote)
//get the highest number of votes //get the highest number of votes
var/greatest_votes = 0 var/greatest_votes = 0
var/total_votes = 0 var/total_votes = 0
if(mode == "gamemode" && CONFIG_GET(flag/must_be_readied_to_vote_gamemode))
for(var/mob/dead/new_player/P in GLOB.player_list)
if(P.ready != PLAYER_READY_TO_PLAY && voted[P.ckey])
choices[choices[voted[P.ckey]]]--
for(var/option in choices) for(var/option in choices)
var/votes = choices[option] var/votes = choices[option]
total_votes += votes total_votes += votes
@@ -101,6 +105,10 @@ SUBSYSTEM_DEF(vote)
/datum/controller/subsystem/vote/proc/calculate_condorcet_votes(var/blackbox_text) /datum/controller/subsystem/vote/proc/calculate_condorcet_votes(var/blackbox_text)
// https://en.wikipedia.org/wiki/Schulze_method#Implementation // https://en.wikipedia.org/wiki/Schulze_method#Implementation
if((mode == "gamemode" || mode == "dynamic") && CONFIG_GET(flag/must_be_readied_to_vote_gamemode))
for(var/mob/dead/new_player/P in GLOB.player_list)
if(P.ready != PLAYER_READY_TO_PLAY && voted[P.ckey])
voted -= P.ckey
var/list/d[][] = new/list(choices.len,choices.len) // the basic vote matrix, how many times a beats b var/list/d[][] = new/list(choices.len,choices.len) // the basic vote matrix, how many times a beats b
for(var/ckey in voted) for(var/ckey in voted)
var/list/this_vote = voted[ckey] var/list/this_vote = voted[ckey]
@@ -147,6 +155,10 @@ SUBSYSTEM_DEF(vote)
for(var/choice in choices) for(var/choice in choices)
scores_by_choice += "[choice]" scores_by_choice += "[choice]"
scores_by_choice["[choice]"] = list() scores_by_choice["[choice]"] = list()
if((mode == "gamemode" || mode == "dynamic") && CONFIG_GET(flag/must_be_readied_to_vote_gamemode))
for(var/mob/dead/new_player/P in GLOB.player_list)
if(P.ready != PLAYER_READY_TO_PLAY && voted[P.ckey])
voted -= P.ckey
for(var/ckey in voted) for(var/ckey in voted)
var/list/this_vote = voted[ckey] var/list/this_vote = voted[ckey]
var/list/pretty_vote = list() var/list/pretty_vote = list()