mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-28 14:37:27 +01:00
Move openspace object updating to event listeners
This commit is contained in:
@@ -79,22 +79,6 @@ SUBSYSTEM_DEF(open_space)
|
||||
/datum/controller/subsystem/open_space/stat_entry(msg_prefix)
|
||||
return ..("T [turfs_to_process.len]")
|
||||
|
||||
/turf/Entered(atom/movable/AM)
|
||||
. = ..()
|
||||
if(GLOB.open_space_initialised && !AM.invisibility && isobj(AM))
|
||||
var/turf/T = GetAbove(src)
|
||||
if(isopenspace(T))
|
||||
// log_debug("[T] ([T.x],[T.y],[T.z]) queued for update for [src].Entered([AM])")
|
||||
SSopen_space.add_turf(T, 1)
|
||||
|
||||
/turf/Exited(atom/movable/AM)
|
||||
. = ..()
|
||||
if(GLOB.open_space_initialised && !AM.invisibility && isobj(AM))
|
||||
var/turf/T = GetAbove(src)
|
||||
if(isopenspace(T))
|
||||
// log_debug("[T] ([T.x],[T.y],[T.z]) queued for update for [src].Exited([AM])")
|
||||
SSopen_space.add_turf(T, 1)
|
||||
|
||||
/obj/update_icon()
|
||||
. = ..()
|
||||
if(GLOB.open_space_initialised && !invisibility && isturf(loc))
|
||||
|
||||
@@ -39,15 +39,30 @@
|
||||
..()
|
||||
update()
|
||||
|
||||
/turf/simulated/open/ChangeTurf()
|
||||
var/turf/T = GetBelow(src)
|
||||
if(T)
|
||||
GLOB.turf_entered_event.unregister(T, src, .proc/BelowOpenUpdated)
|
||||
GLOB.turf_exited_event.unregister(T, src, .proc/BelowOpenUpdated)
|
||||
. = ..()
|
||||
|
||||
/turf/simulated/open/Initialize()
|
||||
. = ..()
|
||||
ASSERT(HasBelow(z))
|
||||
update()
|
||||
var/turf/T = GetBelow(src)
|
||||
if(T)
|
||||
GLOB.turf_entered_event.register(T, src, .proc/BelowOpenUpdated)
|
||||
GLOB.turf_exited_event.register(T, src, .proc/BelowOpenUpdated)
|
||||
|
||||
/turf/simulated/open/Entered(var/atom/movable/mover)
|
||||
. = ..()
|
||||
mover.fall()
|
||||
|
||||
/turf/simulated/open/proc/BelowOpenUpdated(turf/T, atom/movable/AM, old_loc)
|
||||
if(isobj(AM) && GLOB.open_space_initialised && !AM.invisibility)
|
||||
SSopen_space.add_turf(src, 1)
|
||||
|
||||
// Called when thrown object lands on this turf.
|
||||
/turf/simulated/open/hitby(var/atom/movable/AM, var/speed)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user