Added lazy events (#27091)

* Added lazy events

* remember to compile before changing your code

* Converted on_z_transition and on_post_z_transition to lazy events

* add todo

* fix oops

* fix another oops

* and anotha one

* Moved unit tests to the proper place
This commit is contained in:
DamianX
2020-07-15 22:15:44 +02:00
committed by GitHub
parent 15694ba6e0
commit 1e007a1a3e
12 changed files with 158 additions and 50 deletions

View File

@@ -137,9 +137,9 @@
P.reflected = TRUE//you can now get hit by the projectile you just fired. Careful with portals!
if(curturf.z != destturf.z)
INVOKE_EVENT(teleatom.on_z_transition, list("user" = teleatom, "from_z" = curturf.z, "to_z" = destturf.z))
teleatom.lazy_invoke_event(/lazy_event/on_z_transition, list("user" = teleatom, "from_z" = curturf.z, "to_z" = destturf.z))
for(var/atom/movable/AA in recursive_type_check(teleatom))
INVOKE_EVENT(AA.on_z_transition, list("user" = AA, "from_z" = curturf.z, "to_z" = destturf.z))
AA.lazy_invoke_event(/lazy_event/on_z_transition, list("user" = AA, "from_z" = curturf.z, "to_z" = destturf.z))
if(force_teleport)
teleatom.forceMove(destturf,TRUE)