mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-07-22 20:32:46 +01:00
37c6a7d1fc
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request update time related procs & glob too (i was originally targeting that lmao). also **stop** using byondtime for sql stuff, we have `NOW()`!! <!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! --> ## Why It's Good For The Game <!-- Argue for the merits of your changes and how they benefit the game, especially if they are controversial and/or far reaching. If you can't actually explain WHY what you are doing will improve the game, then it probably isn't good for the game in the first place. --> ## Changelog <!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. --> <!-- Both 🆑's are required for the changelog to work! You can put your name to the right of the first 🆑 if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. -->
27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
SUBSYSTEM_DEF(transfer)
|
|
wait = 10 SECONDS
|
|
name = "Transfer"
|
|
var/timerbuffer = 0 //buffer for time check
|
|
var/currenttick = 0
|
|
var/shift_hard_end = 0
|
|
var/shift_last_vote = 0
|
|
|
|
// should be a config someday lol
|
|
#define NUMBER_OF_VOTE_EXTENSIONS 2
|
|
|
|
/datum/controller/subsystem/transfer/Initialize()
|
|
timerbuffer = config_legacy.vote_autotransfer_initial
|
|
shift_hard_end = config_legacy.vote_autotransfer_initial + (config_legacy.vote_autotransfer_interval * NUMBER_OF_VOTE_EXTENSIONS) //Change this "1" to how many extend votes you want there to be.
|
|
shift_last_vote = shift_hard_end - config_legacy.vote_autotransfer_interval
|
|
return SS_INIT_SUCCESS
|
|
|
|
/datum/controller/subsystem/transfer/fire(resumed)
|
|
currenttick = currenttick + 1
|
|
if(STATION_TIME_PASSED() >= shift_hard_end - 1 MINUTE)
|
|
init_shift_change(null, 1)
|
|
shift_hard_end = timerbuffer + config_legacy.vote_autotransfer_interval //If shuttle somehow gets recalled, let's force it to call again next time a vote would occur.
|
|
timerbuffer = timerbuffer + config_legacy.vote_autotransfer_interval //Just to make sure a vote doesn't occur immediately afterwords.
|
|
else if(STATION_TIME_PASSED() >= timerbuffer - 1 MINUTE)
|
|
SSvote.autotransfer()
|
|
timerbuffer = timerbuffer + config_legacy.vote_autotransfer_interval
|