From 0ad49f9004d9537b2b3a39e51f516665182bb504 Mon Sep 17 00:00:00 2001 From: Hatterhat Date: Wed, 19 Feb 2020 17:18:51 -0600 Subject: [PATCH] shit dude i hope this works lmao --- code/controllers/configuration/entries/general.dm | 6 ++++-- code/controllers/subsystem/autotransfer.dm | 14 +++++++++++--- code/controllers/subsystem/vote.dm | 3 +-- config/config.txt | 5 ++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index b5e7137374..2d9264adf5 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -84,12 +84,14 @@ /datum/config_entry/number/vote_autotransfer_initial //length of time before the first autotransfer vote is called (deciseconds, default 2 hours) config_entry_value = 72000 - integer = FALSE min_val = 0 /datum/config_entry/number/vote_autotransfer_interval //length of time to wait before subsequent autotransfer votes (deciseconds, default 30 minutes) config_entry_value = 18000 - integer = FALSE + min_val = 0 + +/datum/config_entry/number/vote_autotransfer_maximum // maximum extensions until the round autoends + config_entry_value = 4 min_val = 0 /datum/config_entry/flag/default_no_vote // vote does not default to nochange/norestart diff --git a/code/controllers/subsystem/autotransfer.dm b/code/controllers/subsystem/autotransfer.dm index 05ef3127c1..00c3f85543 100644 --- a/code/controllers/subsystem/autotransfer.dm +++ b/code/controllers/subsystem/autotransfer.dm @@ -5,13 +5,21 @@ SUBSYSTEM_DEF(autotransfer) var/starttime var/targettime + var/maxvotes + var/curvotes /datum/controller/subsystem/autotransfer/Initialize(timeofday) starttime = world.time targettime = starttime + CONFIG_GET(number/vote_autotransfer_initial) + maxvotes = CONFIG_GET(number/vote_autotransfer_maximum) + curvotes = 0 return ..() /datum/controller/subsystem/autotransfer/fire() - if (world.time > targettime) - SSvote.initiate_vote("transfer",null) //TODO figure out how to not use null as the user - targettime = targettime + CONFIG_GET(number/vote_autotransfer_interval) + if(maxvotes > votes) + if(world.time > targettime) + SSvote.initiate_vote("transfer",null) //TODO figure out how to not use null as the user + targettime = targettime + CONFIG_GET(number/vote_autotransfer_interval) + votes += 1 + else + SSshuttle.autoEnd() diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 9ddd8d9123..9f974595fd 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -381,8 +381,7 @@ SUBSYSTEM_DEF(vote) to_chat(world, "The map vote has chosen [VM.map_name] for next round!") if("transfer") // austation begin -- Crew autotransfer vote if(. == "Initiate Crew Transfer") - //TODO find a cleaner way to do this - SSshuttle.requestEvac(null,"Crew transfer requested.") + SSshuttle.autoEnd() var/obj/machinery/computer/communications/C = locate() in GLOB.machines if(C) C.post_status("shuttle") // austation end diff --git a/config/config.txt b/config/config.txt index cc9ede5ef2..1d987070dd 100644 --- a/config/config.txt +++ b/config/config.txt @@ -187,9 +187,12 @@ VOTE_PERIOD 600 ## autovote initial delay (deciseconds) before first automatic transfer vote call (default 120 minutes) VOTE_AUTOTRANSFER_INITIAL 72000 -##autovote delay (deciseconds) before sequential automatic transfer votes are called (default 30 minutes) +## autovote delay (deciseconds) before sequential automatic transfer votes are called (default 30 minutes) VOTE_AUTOTRANSFER_INTERVAL 18000 +## autovote maximum votes until automatic transfer call (default 4) +VOTE_AUTOTRANSFER_MAXIMUM 4 + ## prevents dead players from voting or starting votes # NO_DEAD_VOTE