diff --git a/code/controllers/subsystem/polling.dm b/code/controllers/subsystem/polling.dm index 8bbb37661c0..fb84df9f050 100644 --- a/code/controllers/subsystem/polling.dm +++ b/code/controllers/subsystem/polling.dm @@ -49,7 +49,6 @@ SUBSYSTEM_DEF(polling) if(role && !is_eligible(candidate_mob, role, check_jobban, ignore_category)) continue - SEND_SOUND(candidate_mob, 'sound/misc/notice2.ogg') if(flash_window) window_flash(candidate_mob.client) @@ -116,7 +115,10 @@ SUBSYSTEM_DEF(polling) var/act_never = "" if(ignore_category) act_never = "\[Never For This Round]" - to_chat(candidate_mob, span_boldnotice(examine_block("Now looking for candidates [role_name_text ? "to play as \an [role_name_text]." : "\"[question]\""] [act_jump] [act_signup] [act_never]"))) + + if(!duplicate_message_check(alert_poll)) //Only notify people once. They'll notice if there are multiple and we don't want to spam people. + SEND_SOUND(candidate_mob, 'sound/misc/notice2.ogg') + to_chat(candidate_mob, span_boldnotice(examine_block("Now looking for candidates [role_name_text ? "to play as \an [role_name_text]." : "\"[question]\""] [act_jump] [act_signup] [act_never]"))) // Start processing it so it updates visually the timer START_PROCESSING(SSprocessing, poll_alert_button) @@ -197,13 +199,8 @@ SUBSYSTEM_DEF(polling) // Take care of updating the remaining screen alerts if a similar poll is found, or deleting them. if(length(finishing_poll.alert_buttons)) - var/polls_of_same_type_left = FALSE - for(var/datum/candidate_poll/running_poll as anything in currently_polling) - if(running_poll.poll_key == finishing_poll.poll_key && running_poll.time_left() > 0) - polls_of_same_type_left = TRUE - break for(var/atom/movable/screen/alert/poll_alert/alert as anything in finishing_poll.alert_buttons) - if(polls_of_same_type_left) + if(duplicate_message_check(finishing_poll)) alert.update_stacks_overlay() else alert.owner.clear_alert("[finishing_poll.poll_key]_poll_alert") @@ -218,6 +215,13 @@ SUBSYSTEM_DEF(polling) msg += " | Next: [DisplayTimeText(soonest_to_complete.time_left())] ([length(soonest_to_complete.signed_up)] candidates)" return ..() +///Is there a multiple of the given event type running right now? +/datum/controller/subsystem/polling/proc/duplicate_message_check(datum/candidate_poll/poll_to_check) + for(var/datum/candidate_poll/running_poll as anything in currently_polling) + if((running_poll.poll_key == poll_to_check.poll_key && running_poll != poll_to_check) && running_poll.time_left() > 0) + return TRUE + return FALSE + /datum/controller/subsystem/polling/proc/get_next_poll_to_finish() var/lowest_time_left = INFINITY var/next_poll_to_finish