Makes some things that rely on atmos adjacency more sane/faster. (#54096)

* Replaces some CANATMOSPASS calls with a new define that checks if the turfs are in each others atmos adjacent list, as that's the same info that they want.
This commit is contained in:
LemonInTheDark
2020-10-01 13:19:52 -07:00
committed by GitHub
parent 08447679d5
commit 0be337d01c
9 changed files with 20 additions and 8 deletions
+5 -1
View File
@@ -110,6 +110,10 @@
return
var/turf/ownturf = get_turf(src)
if(!TURF_SHARES(ownturf)) //If we are in a 1x1 room
addtimer(CALLBACK(src, .proc/Spread), delay_spread, TIMER_UNIQUE|TIMER_NO_HASH_WAIT)
return //Deal with it not now
var/shrooms_planted = 0
var/list/possibleLocs = list()
//Lets collect a list of possible viewable turfs BEFORE we iterate for yield so we don't call view multiple
@@ -118,7 +122,7 @@
for(var/turf/open/floor/earth in view(3,src))
if(is_type_in_typecache(earth, blacklisted_glowshroom_turfs))
continue
if(!ownturf.CanAtmosPass(earth))
if(!TURF_SHARES(earth))
continue
possibleLocs += earth
+4 -2
View File
@@ -125,12 +125,14 @@
/obj/effect/portal/proc/unlink_atmos()
if(istype(atmos_source))
if(istype(atmos_destination) && !atmos_source.Adjacent(atmos_destination) && !CANATMOSPASS(atmos_destination, atmos_source))
if(istype(atmos_destination))
LAZYREMOVE(atmos_source.atmos_adjacent_turfs, atmos_destination)
atmos_source.ImmediateCalculateAdjacentTurfs() //Just in case they were next to each other
atmos_source = null
if(istype(atmos_destination))
if(istype(atmos_source) && !atmos_destination.Adjacent(atmos_source) && !CANATMOSPASS(atmos_source, atmos_destination))
if(istype(atmos_source))
LAZYREMOVE(atmos_destination.atmos_adjacent_turfs, atmos_source)
atmos_destination.ImmediateCalculateAdjacentTurfs()
atmos_destination = null
/obj/effect/portal/Destroy()
+1 -1
View File
@@ -832,7 +832,7 @@ RLD
for(var/direction in GLOB.cardinals)
var/turf/C = get_step(W, direction)
var/list/dupes = checkdupes(C)
if(start.CanAtmosPass(C) && !dupes.len)
if((isspaceturf(C) || TURF_SHARES(C)) && !dupes.len)
candidates += C
if(!candidates.len)
to_chat(user, "<span class='warning'>Valid target not found...</span>")
-1
View File
@@ -524,7 +524,6 @@
T.visible_message("<span class='danger'>[T] smacks into [src] and rapidly flashes to ash.</span>",\
"<span class='hear'>You hear a loud crack as you are washed with a wave of heat.</span>")
shard.Consume()
CALCULATE_ADJACENT_TURFS(T)
/obj/item/melee/supermatter_sword/add_blood_DNA(list/blood_dna)
return FALSE