mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 16:07:40 +00:00
Fixes callbacks and invoke time args failing when pushUsr was used (#35395)
* Fixes callbacks and invoke time args failing when pushUsr was used * y u do dis byond
This commit is contained in:
committed by
CitadelStationBot
parent
d6f916f37b
commit
07e10c38e1
@@ -1506,10 +1506,13 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
|
||||
|
||||
// Makes a call in the context of a different usr
|
||||
// Use sparingly
|
||||
/world/proc/PushUsr(mob/M, datum/callback/CB)
|
||||
/world/proc/PushUsr(mob/M, datum/callback/CB, ...)
|
||||
var/temp = usr
|
||||
usr = M
|
||||
. = CB.Invoke()
|
||||
if (length(args) > 2)
|
||||
. = CB.Invoke(arglist(args.Copy(3)))
|
||||
else
|
||||
. = CB.Invoke()
|
||||
usr = temp
|
||||
|
||||
//Returns a list of all servants of Ratvar and observers.
|
||||
|
||||
@@ -78,11 +78,13 @@
|
||||
if(W)
|
||||
var/mob/M = W.resolve()
|
||||
if(M)
|
||||
if (length(args))
|
||||
return world.PushUsr(arglist(list(M, src) + args))
|
||||
return world.PushUsr(M, src)
|
||||
|
||||
|
||||
if (!object)
|
||||
return
|
||||
|
||||
|
||||
var/list/calling_arguments = arguments
|
||||
if (length(args))
|
||||
if (length(arguments))
|
||||
@@ -104,11 +106,13 @@
|
||||
if(W)
|
||||
var/mob/M = W.resolve()
|
||||
if(M)
|
||||
if (length(args))
|
||||
return world.PushUsr(arglist(list(M, src) + args))
|
||||
return world.PushUsr(M, src)
|
||||
|
||||
|
||||
if (!object)
|
||||
return
|
||||
|
||||
|
||||
var/list/calling_arguments = arguments
|
||||
if (length(args))
|
||||
if (length(arguments))
|
||||
|
||||
Reference in New Issue
Block a user