mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-21 15:14:17 +00:00
## About The Pull Request Makes it so ghosts can vote on transfers after the first one at 2:30 has happened ## Why It's Good For The Game  ## Proof Of Testing it compiles (I tested it and forgor screenshot) ## Changelog 🆑 qol: ghosts can vote on transfers 2 and above /🆑 --------- Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
33 lines
935 B
Plaintext
33 lines
935 B
Plaintext
|
|
/datum/vote
|
|
// Specifies if people who haven't spent INGAME_TIME_NEEDED minutes in the round are allowed to vote
|
|
var/allow_ghosts = TRUE
|
|
|
|
#define INGAME_TIME_NEEDED 30
|
|
|
|
// Checks if a mob can partake in voting. Feel free to add overrides when adding your own votes!
|
|
// This is called directly from /datum/controller/subsystem/vote so some nullchecks are excluded as they are included before this is called
|
|
/datum/vote/proc/can_mob_vote(mob/voter)
|
|
if(SSticker.HasRoundStarted() && !allow_ghosts)
|
|
if(GLOB.client_minutes_in_round[voter.client.ckey] >= INGAME_TIME_NEEDED)
|
|
return TRUE
|
|
else
|
|
return FALSE
|
|
|
|
return TRUE
|
|
|
|
#undef INGAME_TIME_NEEDED
|
|
/datum/vote/transfer_vote
|
|
allow_ghosts = FALSE
|
|
// Has this vote been run before?
|
|
var/has_ran = FALSE
|
|
|
|
/datum/vote/transfer_vote/can_mob_vote(mob/voter)
|
|
if(has_ran)
|
|
return TRUE
|
|
return ..()
|
|
|
|
/datum/vote/transfer_vote/finalize_vote(winning_option)
|
|
has_ran = TRUE
|
|
return ..()
|