Update change_turf.dm

This commit is contained in:
Dennok
2019-08-04 12:05:40 +03:00
parent e587b970da
commit 16e5b8b83c
+6 -7
View File
@@ -138,16 +138,15 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
/turf/open/ChangeTurf(path, list/new_baseturfs, flags) //Resist the temptation to make this default to keeping air.
if ((flags & CHANGETURF_INHERIT_AIR) && ispath(path, /turf/open))
SSair.remove_from_active(src)
var/stashed_air = air
air = null // so that it doesn't get deleted
var/datum/gas_mixture/stashed_air = new()
stashed_air.copy_from(air)
. = ..()
if (!. || . == src) // changeturf failed or didn't do anything
air = stashed_air
if (!.) // changeturf failed or didn't do anything
QDEL_NULL(stashed_air)
return
var/turf/open/newTurf = .
if (!istype(newTurf.air, /datum/gas_mixture/immutable/space))
newTurf.air.copy_from(stashed_air)
QDEL_NULL(stashed_air)
newTurf.air.copy_from(stashed_air)
QDEL_NULL(stashed_air)
SSair.add_to_active(newTurf)
else
if(ispath(path,/turf/closed))