more time proc call fixes

This commit is contained in:
SinTwo
2016-07-30 17:39:47 -04:00
parent 4f7ea573c1
commit b42d46205f
6 changed files with 23 additions and 19 deletions

View File

@@ -29,16 +29,16 @@
return wtime + (time_offset + wusage) * world.tick_lag
var/roundstart_hour = 0
var/roundstart_hour
var/station_date = ""
var/next_station_date_change = 1 DAY
#define station_adjusted_time(time) time2text(time + station_time_in_ticks, "hh:mm")
#define duration2stationtime(time) time2text(station_time_in_ticks + time, "hh:mm")
#define worldtime2stationtime(time) time2text(roundstart_hour HOURS + time, "hh:mm")
#define round_duration_in_ticks (round_start_time ? world.time - round_start_time : 0)
#define station_time_in_ticks (roundstart_hour HOURS + round_duration_in_ticks)
/proc/stationtime2text()
if(!roundstart_hour) roundstart_hour = pick(2,7,12,17)
return time2text(station_time_in_ticks, "hh:mm")
/proc/stationdate2text()
@@ -53,7 +53,7 @@ var/next_station_date_change = 1 DAY
return station_date
/proc/time_stamp()
return time2text(world.timeofday, "hh:mm:ss")
return time2text(station_time_in_ticks, "hh:mm:ss")
/* Returns 1 if it is the selected month and day */
proc/isDay(var/month, var/day)
@@ -96,4 +96,8 @@ var/round_start_time = 0
//Can be useful for things dependent on process timing
/proc/process_schedule_interval(var/process_name)
var/datum/controller/process/process = processScheduler.getProcess(process_name)
return process.schedule_interval
return process.schedule_interval
/hook/startup/proc/set_roundstart_hour()
roundstart_hour = pick(2,7,12,17)
return 1

View File

@@ -410,7 +410,7 @@
visible_message("<span class='notice'>\The [src] rattles and prints out a sheet of paper.</span>")
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc)
P.info = "<CENTER><B>Body Scan - [href_list["name"]]</B></CENTER><BR>"
P.info += "<b>Time of scan:</b> [stationtime2text(world.time)]<br><br>"
P.info += "<b>Time of scan:</b> [worldtime2stationtime(world.time)]<br><br>"
P.info += "[printing_text]"
P.info += "<br><br><b>Notes:</b><br>"
P.name = "Body Scan - [href_list["name"]]"

View File

@@ -20,17 +20,17 @@
/obj/item/weapon/card/id/guest/examine(mob/user)
..(user)
if (world.time < expiration_time)
user << "<span class='notice'>This pass expires at [stationtime2text(expiration_time)].</span>"
user << "<span class='notice'>This pass expires at [worldtime2stationtime(expiration_time)].</span>"
else
user << "<span class='warning'>It expired at [stationtime2text(expiration_time)].</span>"
user << "<span class='warning'>It expired at [worldtime2stationtime(expiration_time)].</span>"
/obj/item/weapon/card/id/guest/read()
if(!Adjacent(usr))
return //Too far to read
if (world.time > expiration_time)
usr << "<span class='notice'>This pass expired at [stationtime2text(expiration_time)].</span>"
usr << "<span class='notice'>This pass expired at [worldtime2stationtime(expiration_time)].</span>"
else
usr << "<span class='notice'>This pass expires at [stationtime2text(expiration_time)].</span>"
usr << "<span class='notice'>This pass expires at [worldtime2stationtime(expiration_time)].</span>"
usr << "<span class='notice'>It grants access to following areas:</span>"
for (var/A in temp_access)
@@ -213,7 +213,7 @@
if (A)
var/area = get_access_desc(A)
entry += "[i > 1 ? ", [area]" : "[area]"]"
entry += ". Expires at [stationtime2text(world.time + duration*10*60)]."
entry += ". Expires at [worldtime2stationtime(world.time + duration*10*60)]."
internal_log.Add(entry)
var/obj/item/weapon/card/id/guest/pass = new(src.loc)

View File

@@ -158,7 +158,7 @@
nanoui_data["categories"] = categories
nanoui_data["discount_name"] = discount_item ? discount_item.name : ""
nanoui_data["discount_amount"] = (1-discount_amount)*100
nanoui_data["offer_expiry"] = stationtime2text(next_offer_time)
nanoui_data["offer_expiry"] = worldtime2stationtime(next_offer_time)
else if(nanoui_menu == 1)
var/items[0]
for(var/datum/uplink_item/item in category.items)

View File

@@ -86,7 +86,7 @@
var/scan_data = ""
if(timeofdeath)
scan_data += "<b>Time of death:</b> [stationtime2text(timeofdeath)]<br><br>"
scan_data += "<b>Time of death:</b> [worldtime2stationtime(timeofdeath)]<br><br>"
var/n = 1
for(var/wdata_idx in wdata)
@@ -133,7 +133,7 @@
if(damaging_weapon)
scan_data += "Severity: [damage_desc]<br>"
scan_data += "Hits by weapon: [total_hits]<br>"
scan_data += "Approximate time of wound infliction: [stationtime2text(age)]<br>"
scan_data += "Approximate time of wound infliction: [worldtime2stationtime(age)]<br>"
scan_data += "Affected limbs: [D.organ_names]<br>"
scan_data += "Possible weapons:<br>"
for(var/weapon_name in weapon_chances)

View File

@@ -44,7 +44,7 @@
if(EM.add_to_queue)
EC.available_events += EM
log_debug("Event '[EM.name]' has completed at [stationtime2text()].")
log_debug("Event '[EM.name]' has completed at [worldtime2stationtime(world.time)].")
/datum/event_manager/proc/delay_events(var/severity, var/delay)
var/list/datum/event_container/EC = event_containers[severity]
@@ -67,12 +67,12 @@
var/datum/event_meta/EM = E.event_meta
if(EM.name == "Nothing")
continue
var/message = "'[EM.name]' began at [stationtime2text(E.startedAt)] "
var/message = "'[EM.name]' began at [worldtime2stationtime(E.startedAt)] "
if(E.isRunning)
message += "and is still running."
else
if(E.endedAt - E.startedAt > MinutesToTicks(5)) // Only mention end time if the entire duration was more than 5 minutes
message += "and ended at [stationtime2text(E.endedAt)]."
message += "and ended at [worldtime2stationtime(E.endedAt)]."
else
message += "and ran to completion."
@@ -130,7 +130,7 @@
var/next_event_at = max(0, EC.next_event_time - world.time)
html += "<tr>"
html += "<td>[severity_to_string[severity]]</td>"
html += "<td>[stationtime2text(max(EC.next_event_time, world.time))]</td>"
html += "<td>[worldtime2stationtime(max(EC.next_event_time, world.time))]</td>"
html += "<td>[round(next_event_at / 600, 0.1)]</td>"
html += "<td>"
html += "<A align='right' href='?src=\ref[src];dec_timer=2;event=\ref[EC]'>--</A>"
@@ -178,7 +178,7 @@
html += "<tr>"
html += "<td>[severity_to_string[EM.severity]]</td>"
html += "<td>[EM.name]</td>"
html += "<td>[stationtime2text(ends_at)]</td>"
html += "<td>[worldtime2stationtime(ends_at)]</td>"
html += "<td>[ends_in]</td>"
html += "<td><A align='right' href='?src=\ref[src];stop=\ref[E]'>Stop</A></td>"
html += "</tr>"