mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-31 01:00:59 +01:00
[MIRROR] Verb manager subsystem & Speech controller (#9559)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Heroman3003
Kashargul
parent
d0b64d915e
commit
06f69815dd
@@ -0,0 +1,27 @@
|
||||
///like normal callbacks but they also record their creation time for measurement purposes
|
||||
///they also require the same usr/user that made the callback to both still exist and to still have a client in order to execute
|
||||
/datum/callback/verb_callback
|
||||
///the tick this callback datum was created in. used for testing latency
|
||||
var/creation_time = 0
|
||||
|
||||
/datum/callback/verb_callback/New(thingtocall, proctocall, ...)
|
||||
creation_time = DS2TICKS(world.time)
|
||||
. = ..()
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
/datum/callback/verb_callback/Invoke(...)
|
||||
var/mob/our_user = user?.resolve()
|
||||
if(QDELETED(our_user) || isnull(our_user.client))
|
||||
return
|
||||
var/mob/temp = usr
|
||||
. = ..()
|
||||
usr = temp
|
||||
|
||||
/datum/callback/verb_callback/InvokeAsync(...)
|
||||
var/mob/our_user = user?.resolve()
|
||||
if(QDELETED(our_user) || isnull(our_user.client))
|
||||
return
|
||||
var/mob/temp = usr
|
||||
. = ..()
|
||||
usr = temp
|
||||
#endif
|
||||
Reference in New Issue
Block a user