Allows you to define a base turf for an area which overrides the z-level's base turf in unsorted.dm.

It will first check to see if the turf is set, and if not it will still use the z-level default.
This means we can mark areas as having a base of space to override the z-level base of asteroid that we're using.
As a result, we can ensure the bombs, shuttles moving, etc. leave behind an space turf by defining shuttles, solars/"external" areas as using space as a base.
Areas will need to be updated to check with base_turf = /turf/space and references to the old get_base_turf proc updated so all calls (bombs, Nar'Sie, deconstruction, etc.) have the correct effect, but it's tired and I want to commit this now so I'm committed to finishing it tomorrow.
This commit is contained in:
Jon
2015-12-06 13:18:46 -05:00
committed by HarpyEagle
parent 2383e5cdcb
commit edb50b3504
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -860,7 +860,7 @@ proc/GaussRandRound(var/sigma,var/roundto)
if(turftoleave)
fromupdate += T.ChangeTurf(turftoleave)
else
T.ChangeTurf(get_base_turf(T.z))
T.ChangeTurf(get_base_turf_by_area(T))
refined_src -= T
refined_trg -= B
+2
View File
@@ -53,6 +53,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
var/list/forced_ambience = null
var/sound_env = STANDARD_STATION
var/turf/base_turf //The base turf type of the area, which can be used to override the z-level's base turf
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
var/list/teleportlocs = list()
+8 -1
View File
@@ -1,4 +1,4 @@
// Returns the lowest turf available on a given Z-level, defaults to space.
// Returns the lowest turf available on a given Z-level, defaults to asteroid for Polaris.
var/global/list/base_turf_by_z = list(
"5" = /turf/simulated/floor/asteroid // Moonbase.
)
@@ -8,6 +8,13 @@ proc/get_base_turf(var/z)
base_turf_by_z["[z]"] = /turf/space
return base_turf_by_z["[z]"]
//An area can override the z-level base turf, so our solar array areas etc. can be space-based.
proc/get_base_turf_by_area(var/turf/T)
var/area/A = T.loc
if(A.base_turf)
return A.base_turf
return get_base_turf(T.z)
/client/proc/set_base_turf()
set category = "Debug"
set name = "Set Base Turf"