Replaces some zero-delay timers with INVOKE_ASYNC (#52434)

* INVOKE_ASYNC

Replaces a zero-delay timer with INVOKE_ASYNC

* More timers

Switches out some more zero-delay timers for `INVOKE_ASYNC`

* lib_codex_gigas

One last switch
This commit is contained in:
TemporalOroboros
2020-07-26 19:09:58 -07:00
committed by SkyratBot
parent 19cf64c475
commit 1ca448ae1f
7 changed files with 7 additions and 7 deletions

View File

@@ -58,7 +58,7 @@ Simple datum which is instanced once per type and is used for every object of sa
source.name = "[name] [source.name]" source.name = "[name] [source.name]"
if(beauty_modifier) if(beauty_modifier)
addtimer(CALLBACK(source, /datum.proc/_AddComponent, list(/datum/component/beauty, beauty_modifier * amount)), 0) INVOKE_ASYNC(source, /datum.proc/_AddComponent, list(/datum/component/beauty, beauty_modifier * amount))
if(istype(source, /obj)) //objs if(istype(source, /obj)) //objs
on_applied_obj(source, amount, material_flags) on_applied_obj(source, amount, material_flags)

View File

@@ -69,7 +69,7 @@
name = "poster - [name]" name = "poster - [name]"
desc = "A large piece of space-resistant printed paper. [desc]" desc = "A large piece of space-resistant printed paper. [desc]"
addtimer(CALLBACK(src, /datum.proc/_AddComponent, list(/datum/component/beauty, 300)), 0) INVOKE_ASYNC(src, /datum.proc/_AddComponent, list(/datum/component/beauty, 300))
/obj/structure/sign/poster/proc/randomise(base_type) /obj/structure/sign/poster/proc/randomise(base_type)
var/list/poster_types = subtypesof(base_type) var/list/poster_types = subtypesof(base_type)

View File

@@ -26,7 +26,7 @@
if(LAZYLEN(diseases_to_add)) if(LAZYLEN(diseases_to_add))
AddComponent(/datum/component/infective, diseases_to_add) AddComponent(/datum/component/infective, diseases_to_add)
addtimer(CALLBACK(src, /datum.proc/_AddComponent, list(/datum/component/beauty, beauty)), 0) INVOKE_ASYNC(src, /datum.proc/_AddComponent, list(/datum/component/beauty, beauty))
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
if(T && is_station_level(T.z)) if(T && is_station_level(T.z))

View File

@@ -503,7 +503,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
/obj/item/statuebust/Initialize() /obj/item/statuebust/Initialize()
. = ..() . = ..()
AddComponent(/datum/component/art, impressiveness) AddComponent(/datum/component/art, impressiveness)
addtimer(CALLBACK(src, /datum.proc/_AddComponent, list(/datum/component/beauty, 1000)), 0) INVOKE_ASYNC(src, /datum.proc/_AddComponent, list(/datum/component/beauty, 1000))
/obj/item/statuebust/hippocratic /obj/item/statuebust/hippocratic
name = "hippocrates bust" name = "hippocrates bust"

View File

@@ -315,8 +315,8 @@
/obj/item/kirbyplants/ComponentInitialize() /obj/item/kirbyplants/ComponentInitialize()
. = ..() . = ..()
AddComponent(/datum/component/tactical) AddComponent(/datum/component/tactical)
addtimer(CALLBACK(src, /datum.proc/_AddComponent, list(/datum/component/beauty, 500)), 0)
AddComponent(/datum/component/two_handed, require_twohands=TRUE, force_unwielded=10, force_wielded=10) AddComponent(/datum/component/two_handed, require_twohands=TRUE, force_unwielded=10, force_wielded=10)
INVOKE_ASYNC(src, /datum.proc/_AddComponent, list(/datum/component/beauty, 500))
/obj/item/kirbyplants/random /obj/item/kirbyplants/random
icon = 'icons/obj/flora/_flora.dmi' icon = 'icons/obj/flora/_flora.dmi'

View File

@@ -15,7 +15,7 @@
/obj/structure/statue/Initialize() /obj/structure/statue/Initialize()
. = ..() . = ..()
AddComponent(art_type, impressiveness) AddComponent(art_type, impressiveness)
addtimer(CALLBACK(src, /datum.proc/_AddComponent, list(/datum/component/beauty, impressiveness * 75)), 0) INVOKE_ASYNC(src, /datum.proc/_AddComponent, list(/datum/component/beauty, impressiveness * 75))
/obj/structure/statue/attackby(obj/item/W, mob/living/user, params) /obj/structure/statue/attackby(obj/item/W, mob/living/user, params)
add_fingerprint(user) add_fingerprint(user)

View File

@@ -71,7 +71,7 @@
return FALSE return FALSE
if(action == "search") if(action == "search")
SStgui.close_uis(src) SStgui.close_uis(src)
addtimer(CALLBACK(src, .proc/perform_research, usr, currentName), 0) INVOKE_ASYNC(src, .proc/perform_research, usr, currentName)
currentName = "" currentName = ""
currentSection = PRE_TITLE currentSection = PRE_TITLE
return FALSE return FALSE