Refactors baseturf (#2778)

Modifies baseturf to be used instead of not used. Now all functions that used to call "get_base_turf_by_area(T)" will now call "T.baseturf". Turfs that do not have a baseturf defined will set their baseturf to be the result of "get_base_turf_by_area()", which will descend into "get_base_turf_by_z" and ultimately into "turf/space", if none of the previous stages catch.

ChangeTurf will now only keep baseturf persistent from father to child if the child has no baseturf set by code.

This allows for special turfs, such as ceilings, to have their own base turf, such as open space, to be used instead of the area/z baseturf.

Fixes #2763
This commit is contained in:
LordFowl
2017-06-22 13:16:06 +03:00
committed by skull132
parent bcccd88fd4
commit f604e14933
10 changed files with 39 additions and 30 deletions
+2 -2
View File
@@ -98,7 +98,7 @@
build_delay = 50
build_type = "airlock"
build_other = /obj/machinery/door/airlock
else if(!deconstruct && (istype(T,/turf/space) || istype(T,get_base_turf_by_area(T))))
else if(!deconstruct && (istype(T,/turf/space) || istype(T,T.baseturf)))
build_cost = 1
build_type = "floor"
build_turf = /turf/simulated/floor/airless
@@ -112,7 +112,7 @@
build_delay = deconstruct ? 50 : 20
build_cost = deconstruct ? 10 : 3
build_type = deconstruct ? "floor" : "wall"
build_turf = deconstruct ? get_base_turf(T.z) : /turf/simulated/wall
build_turf = deconstruct ? T.baseturf : /turf/simulated/wall
else
return 0