Callback security and usr (#33599)

* Gonna regret writing this one day

* tmp -> temp

* Make PushUsr() a /world proc

* Callbacks now preserve usr

* Fixes PushUsr return value

* Fixes PushUsr invocations

* Update modifyvariables.dm

* Use weakrefs in callback user

* Further fixes

* Whoopsie
This commit is contained in:
Jordan Brown
2017-12-18 21:41:33 -06:00
committed by CitadelStationBot
parent d5708c981a
commit fabfad270f
3 changed files with 38 additions and 3 deletions
+8
View File
@@ -1508,6 +1508,14 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
return "\[[url_encode(thing.tag)]\]"
return "\ref[input]"
// Makes a call in the context of a different usr
// Use sparingly
/world/proc/PushUsr(mob/M, datum/callback/CB)
var/temp = usr
usr = M
. = CB.Invoke()
usr = temp
//Returns a list of all servants of Ratvar and observers.
/proc/servants_and_ghosts()
. = list()