Makes the autotransfer subsystem a bit more optional.

This commit is contained in:
Ghommie
2020-03-12 21:02:34 +01:00
parent c6a9423c51
commit 663a849afe
5 changed files with 30 additions and 15 deletions
@@ -82,7 +82,9 @@
config_entry_value = 600
min_val = 0
/datum/config_entry/number/vote_autotransfer_initial //length of time before the first autotransfer vote is called (deciseconds, default 2 hours)
/// Length of time before the first autotransfer vote is called (deciseconds, default 2 hours)
/// Set to 0 to disable the subsystem altogether.
/datum/config_entry/number/vote_autotransfer_initial
config_entry_value = 72000
min_val = 0
@@ -90,7 +92,7 @@
config_entry_value = 18000
min_val = 0
/datum/config_entry/number/vote_autotransfer_maximum // maximum extensions until the round autoends
/datum/config_entry/number/vote_autotransfer_maximum // maximum extensions until the round autoends, set to 0 to disable.
config_entry_value = 4
min_val = 0
+12 -3
View File
@@ -7,18 +7,27 @@ SUBSYSTEM_DEF(autotransfer)
var/targettime
var/voteinterval
var/maxvotes
var/curvotes
var/curvotes = 0
/datum/controller/subsystem/autotransfer/Initialize(timeofday)
var/init_vote = CONFIG_GET(number/vote_autotransfer_initial)
if(init_vote == 0) //Autotransfer voting disabled.
can_fire = FALSE
return ..()
starttime = world.time
targettime = starttime + CONFIG_GET(number/vote_autotransfer_initial)
targettime = starttime + init_vote
voteinterval = CONFIG_GET(number/vote_autotransfer_interval)
maxvotes = CONFIG_GET(number/vote_autotransfer_maximum)
curvotes = 0
return ..()
/datum/controller/subsystem/autotransfer/Recover()
starttime = SSautotransfer.starttime
voteinterval = SSautotransfer.voteinterval
curvotes = SSautotransfer.curvotes
/datum/controller/subsystem/autotransfer/fire()
if(maxvotes > curvotes)
if(!maxvotes || maxvotes > curvotes)
if(world.time > targettime)
SSvote.initiate_vote("transfer","server")
targettime = targettime + voteinterval