mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-10 15:36:47 +01:00
1fbead50af
Part 3 of the Mob Destroy Refactor, this time going through the entire list of every ref stored up to a mob/human, and (attempting) to verify and cleanup every possible circular ref. This PR also fixes some mistakes made with cleaning up UI elements, namely that tgui's really don't like it when you qdel them, and screen objects also weren't always clearing their own references if Qdel'ed directly. There were several niche situations too where circle refs might be retained by a mob. I also found an issue where static lights were only cleaned up on /atom/movable/ but actually existed farther up the chain on /atom. I don't know if any /atoms that aren't /atom/movable ever get static lights, but the fact that they can be needs to be correctly accounted for. I can't possibly have gotten all of them, but this is every single one I could find after 3 hours of work.
77 lines
2.1 KiB
Plaintext
77 lines
2.1 KiB
Plaintext
/// Pre-check proc for passing things over the turf. Passes more advanced checks for AMs to turf/enter(...), otherwise handles ZAS.
|
|
/turf/CanPass(atom/movable/mover, turf/target, height=1.5,air_group=0)
|
|
if(!target)
|
|
return FALSE
|
|
|
|
if(mover?.movement_type & PHASING)
|
|
return TRUE
|
|
|
|
if(istype(mover)) // turf/Enter(...) will perform more advanced checks
|
|
return !density
|
|
|
|
else // Now, doing more detailed checks for air movement and air group formation
|
|
if(target.blocks_air||blocks_air)
|
|
return FALSE
|
|
|
|
for(var/obj/obstacle in src)
|
|
if(!obstacle.CanPass(mover, target, height, air_group))
|
|
return FALSE
|
|
if(target != src)
|
|
for(var/obj/obstacle in target)
|
|
if(!obstacle.CanPass(mover, src, height, air_group))
|
|
return FALSE
|
|
|
|
return TRUE
|
|
|
|
/// Convenience function for atoms to update turfs they occupy
|
|
/atom/movable/proc/update_nearby_tiles(need_rebuild)
|
|
for(var/turf/simulated/turf in locs)
|
|
SSair.mark_for_update(turf)
|
|
|
|
return 1
|
|
|
|
/**
|
|
* Basically another way of calling CanPass(null, other, 0, 0) and CanPass(null, other, 1.5, 1).
|
|
*
|
|
* Returns:
|
|
* - 0 - Not blocked
|
|
* - AIR_BLOCKED - Blocked
|
|
* - ZONE_BLOCKED - Not blocked, but zone boundaries will not cross.
|
|
* - BLOCKED - Blocked, zone boundaries will not cross even if opened.
|
|
*/
|
|
/atom/proc/c_airblock(turf/other)
|
|
#ifdef ZASDBG
|
|
ASSERT(isturf(other))
|
|
#endif
|
|
return (AIR_BLOCKED*!CanPass(null, other, 0, 0))|(ZONE_BLOCKED*!CanPass(null, other, 1.5, 1))
|
|
|
|
|
|
/turf/c_airblock(turf/other)
|
|
#ifdef ZASDBG
|
|
ASSERT(isturf(other))
|
|
#endif
|
|
if(((blocks_air & AIR_BLOCKED) || (other.blocks_air & AIR_BLOCKED)))
|
|
return BLOCKED
|
|
|
|
//Z-level handling code. Always block if there isn't an open space.
|
|
#ifdef MULTIZAS
|
|
if(other.z != src.z)
|
|
if(other.z < src.z)
|
|
if(!isopenturf(src)) return BLOCKED
|
|
else
|
|
if(!isopenturf(other)) return BLOCKED
|
|
#endif
|
|
|
|
if(((blocks_air & ZONE_BLOCKED) || (other.blocks_air & ZONE_BLOCKED)))
|
|
if(z == other.z)
|
|
return ZONE_BLOCKED
|
|
else
|
|
return AIR_BLOCKED
|
|
|
|
var/result = 0
|
|
for(var/mm in contents)
|
|
var/atom/movable/M = mm
|
|
result |= M.c_airblock(other)
|
|
if(result == BLOCKED) return BLOCKED
|
|
return result
|