Skip to content

Commit

Permalink
Debiases commendation polling (#418)
Browse files Browse the repository at this point in the history
Shuffles JPL before doing commendation poll selection.
  • Loading branch information
francinum committed Jul 19, 2023
1 parent f766e9e commit 6b6de64
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions code/__HELPERS/hearted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
if(!CONFIG_GET(number/commendation_percent_poll))
return

var/number_to_ask = round(LAZYLEN(GLOB.joined_player_list) * CONFIG_GET(number/commendation_percent_poll)) + rand(0,1)
//This does an implicit copy(), I have no idea why JPL is a lazylist, but there's no LAZYSHUFFLE() so get fucked.
var/list/ckeys_to_ask = shuffle(GLOB.joined_player_list)
var/number_to_ask = round(LAZYLEN(ckeys_to_ask) * CONFIG_GET(number/commendation_percent_poll)) + rand(0,1)


if(number_to_ask == 0)
message_admins("Not enough eligible players to poll for commendations.")
return
message_admins("Polling [number_to_ask] players for commendations.")

for(var/i in GLOB.joined_player_list)
for(var/i in ckeys_to_ask)
var/mob/check_mob = get_mob_by_ckey(i)
if(!check_mob?.mind || !check_mob.client)
continue
Expand Down Expand Up @@ -44,9 +48,9 @@
if(1)
heart_nominee = tgui_input_text(src, "What was their name? Just a first or last name may be enough.", "<3?")
if(2)
heart_nominee = tgui_input_text(src, "Try again, what was their name? Just a first or last name may be enough.", "<3?")
heart_nominee = tgui_input_text(src, "Try again, what was their name? Just a first or last name may be enough.", "<3??")
if(3)
heart_nominee = tgui_input_text(src, "One more try, what was their name? Just a first or last name may be enough.", "<3?")
heart_nominee = tgui_input_text(src, "One more try, what was their name? Just a first or last name may be enough.", "<3???")

if(!heart_nominee)
return
Expand All @@ -69,7 +73,7 @@
return
if("Nope")
continue
else
else //Cancel
return

query_heart(attempt + 1)
Expand Down

0 comments on commit 6b6de64

Please sign in to comment.