mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
Merge pull request #13408 from neersighted/hotfix
Hotfix for SStimer lag
This commit is contained in:
@@ -6,11 +6,13 @@ var/datum/subsystem/timer/SStimer
|
||||
priority = 1
|
||||
|
||||
var/list/datum/timedevent/processing
|
||||
var/list/hashes
|
||||
|
||||
|
||||
/datum/subsystem/timer/New()
|
||||
NEW_SS_GLOBAL(SStimer)
|
||||
processing = list()
|
||||
hashes = list()
|
||||
|
||||
|
||||
/datum/subsystem/timer/stat_entry(msg)
|
||||
@@ -34,6 +36,7 @@ var/datum/subsystem/timer/SStimer
|
||||
var/timeToRun
|
||||
var/argList
|
||||
var/id
|
||||
var/hash
|
||||
var/static/nextid = 1
|
||||
|
||||
/datum/timedevent/New()
|
||||
@@ -42,9 +45,10 @@ var/datum/subsystem/timer/SStimer
|
||||
|
||||
/datum/timedevent/Destroy()
|
||||
SStimer.processing -= src
|
||||
SStimer.hashes -= src.hash
|
||||
return ..()
|
||||
|
||||
/proc/addtimer(thingToCall, procToCall, wait, ...)
|
||||
/proc/addtimer(thingToCall, procToCall, wait, unique = FALSE, ...)
|
||||
if (!SStimer) //can't run timers before the mc has been created
|
||||
return
|
||||
if (!thingToCall || !procToCall || wait <= 0)
|
||||
@@ -57,11 +61,17 @@ var/datum/subsystem/timer/SStimer
|
||||
event.thingToCall = thingToCall
|
||||
event.procToCall = procToCall
|
||||
event.timeToRun = world.time + wait
|
||||
event.hash = list2text(args)
|
||||
if (args.len > 3)
|
||||
event.argList = args.Copy(4)
|
||||
|
||||
// Check for dupes if unique = 1.
|
||||
if(unique)
|
||||
if(event.hash in SStimer.hashes)
|
||||
return
|
||||
// If we are unique (or we're not checking that), add the timer and return the id.
|
||||
SStimer.processing += event
|
||||
|
||||
SStimer.hashes += event.hash
|
||||
return event.id
|
||||
|
||||
/proc/deltimer(id)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
//Force nexuses after 2 minutes in hand of god mode
|
||||
if(ticker && ticker.mode && ticker.mode.name == "hand of god")
|
||||
addtimer(src,"forceplacenexus",1200)
|
||||
addtimer(src, "forceplacenexus", 1200, FALSE)
|
||||
|
||||
ghostimage = image(src.icon,src,src.icon_state)
|
||||
ghost_darkness_images |= ghostimage
|
||||
|
||||
@@ -255,7 +255,7 @@ var/global/datum/crewmonitor/crewmonitor = new
|
||||
return ..()
|
||||
|
||||
/datum/crewmonitor/proc/queueUpdate(z)
|
||||
addtimer(crewmonitor, "update", 5, z)
|
||||
addtimer(crewmonitor, "update", 5, TRUE, z)
|
||||
|
||||
/datum/crewmonitor/proc/generateMiniMaps()
|
||||
for(var/z = 1 to world.maxz)
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
|
||||
/obj/attack_ghost(mob/user)
|
||||
ui_interact(user)
|
||||
..()
|
||||
|
||||
/obj/proc/interact(mob/user)
|
||||
return
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
//remove our adminhelp verb temporarily to prevent spamming of admins.
|
||||
src.verbs -= /client/verb/adminhelp
|
||||
adminhelptimerid = addtimer(src,"giveadminhelpverb",1200) //2 minute cooldown of admin helps
|
||||
adminhelptimerid = addtimer(src, "giveadminhelpverb", 1200, FALSE) //2 minute cooldown of admin helps
|
||||
|
||||
msg = keywords_lookup(msg)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user