From 5dddb44e31bd37744b5688825c10c898d540e721 Mon Sep 17 00:00:00 2001 From: BurgerLUA Date: Thu, 8 Nov 2018 17:28:48 -0800 Subject: [PATCH] added (#5581) --- code/_helpers/time.dm | 5 ++- code/modules/admin/player_panel.dm | 2 +- .../mob/abstract/new_player/new_player.dm | 2 +- .../burgerbb - midnight rollover.yml | 37 +++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 html/changelogs/burgerbb - midnight rollover.yml diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index f742ba450e8..62e3f3fd3bd 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -31,7 +31,7 @@ var/round_start_time var/real_round_start_time /proc/get_round_duration() //Real time since round has started, in ticks. - return real_round_start_time ? REALTIMEOFDAY - real_round_start_time : 0 + return real_round_start_time ? (REALTIMEOFDAY - real_round_start_time) : 0 /proc/get_round_duration_formatted() var/duration = get_round_duration() @@ -48,7 +48,8 @@ var/real_round_start_time /var/rollovercheck_last_timeofday = 0 /proc/update_midnight_rollover() if (world.timeofday < rollovercheck_last_timeofday) //TIME IS GOING BACKWARDS! - return midnight_rollovers++ + midnight_rollovers += 1 + rollovercheck_last_timeofday = world.timeofday return midnight_rollovers //returns timestamp in a sql and ISO 8601 friendly format diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 7aac4991c3f..97bb3d693f8 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -392,7 +392,7 @@ if (SSticker.current_state >= GAME_STATE_PLAYING) var/dat = "Round Status

Round Status

" dat += "Current Game Mode: [SSticker.mode.name]
" - dat += "Round Duration: [round(world.time / 36000)]:[add_zero(world.time / 600 % 60, 2)]:[world.time / 100 % 6][world.time / 100 % 10]
" + dat += "Round Duration: [get_round_duration_formatted()]" dat += "Emergency shuttle
" if (!emergency_shuttle.online()) dat += "Call Shuttle
" diff --git a/code/modules/mob/abstract/new_player/new_player.dm b/code/modules/mob/abstract/new_player/new_player.dm index 2732c233b95..139889bf8aa 100644 --- a/code/modules/mob/abstract/new_player/new_player.dm +++ b/code/modules/mob/abstract/new_player/new_player.dm @@ -360,7 +360,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player) var/dat = "
" dat += "Welcome, [name].
" - dat += "Round Duration: [get_round_duration()]
" + dat += "Round Duration: [get_round_duration_formatted()]
" if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles. if(emergency_shuttle.going_to_centcom()) //Shuttle is going to centcomm, not recalled diff --git a/html/changelogs/burgerbb - midnight rollover.yml b/html/changelogs/burgerbb - midnight rollover.yml new file mode 100644 index 00000000000..d40a11c3612 --- /dev/null +++ b/html/changelogs/burgerbb - midnight rollover.yml @@ -0,0 +1,37 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +################################# + +# Your name. +author: BurgerBB + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixed midnight rollover times that resulted in funky round duration times, among other things."