mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-06 07:22:15 +00:00
Misc changes & Fixes (#2922)
changes: Roof auto-gen is now off by default and must be turned on at the area level. Fixed #2921. Added a unit test to check if all station areas have a roof. Slightly tweaked how baseturf is populated; should be functionally the same.
This commit is contained in:
@@ -121,29 +121,28 @@
|
||||
off_states.Cut()
|
||||
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(P.update)
|
||||
var/ref_layer = 0
|
||||
switch(P.dir)
|
||||
if(NORTH)
|
||||
ref_layer = 1
|
||||
if(SOUTH)
|
||||
ref_layer = 2
|
||||
if(EAST)
|
||||
ref_layer = 3
|
||||
if(WEST)
|
||||
ref_layer = 4
|
||||
var/ref_layer = 0
|
||||
switch(P.dir)
|
||||
if(NORTH)
|
||||
ref_layer = 1
|
||||
if(SOUTH)
|
||||
ref_layer = 2
|
||||
if(EAST)
|
||||
ref_layer = 3
|
||||
if(WEST)
|
||||
ref_layer = 4
|
||||
|
||||
if(!ref_layer)
|
||||
continue
|
||||
if(!ref_layer)
|
||||
continue
|
||||
|
||||
var/list/underlay_icon = select_port_icons(P)
|
||||
if(underlay_icon)
|
||||
if(P.node)
|
||||
underlays_current[ref_layer] = underlay_icon
|
||||
else
|
||||
underlays_current[ref_layer] = null
|
||||
var/list/underlay_icon = select_port_icons(P)
|
||||
if(underlay_icon)
|
||||
if(P.node)
|
||||
underlays_current[ref_layer] = underlay_icon
|
||||
else
|
||||
underlays_current[ref_layer] = null
|
||||
else
|
||||
underlays_current[ref_layer] = null
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s
|
||||
|
||||
//Area flags, possibly more to come
|
||||
#define RAD_SHIELDED 1 //shielded from radiation, clearly
|
||||
#define SPAWN_ROOF 2 // if we should attempt to spawn a roof above us.
|
||||
|
||||
// Custom layer definitions, supplementing the default TURF_LAYER, MOB_LAYER, etc.
|
||||
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
|
||||
|
||||
@@ -129,10 +129,11 @@ area/space/atmosalert()
|
||||
requires_power = 0
|
||||
sound_env = SMALL_ENCLOSED
|
||||
no_light_control = 1
|
||||
flags = SPAWN_ROOF
|
||||
|
||||
/area/shuttle/arrival
|
||||
name = "\improper Arrival Shuttle"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/arrival/centcom
|
||||
icon_state = "shuttle2"
|
||||
@@ -164,7 +165,7 @@ area/space/atmosalert()
|
||||
|
||||
/area/shuttle/escape
|
||||
name = "\improper Emergency Shuttle"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/escape/station
|
||||
name = "\improper Emergency Shuttle Station"
|
||||
@@ -185,7 +186,7 @@ area/space/atmosalert()
|
||||
|
||||
/area/shuttle/escape_pod1
|
||||
name = "\improper Escape Pod One"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/escape_pod1/station
|
||||
icon_state = "shuttle2"
|
||||
@@ -203,7 +204,7 @@ area/space/atmosalert()
|
||||
|
||||
/area/shuttle/escape_pod2
|
||||
name = "\improper Escape Pod Two"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/escape_pod2/station
|
||||
icon_state = "shuttle2"
|
||||
@@ -221,7 +222,7 @@ area/space/atmosalert()
|
||||
|
||||
/area/shuttle/escape_pod3
|
||||
name = "\improper Escape Pod Three"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/escape_pod3/station
|
||||
icon_state = "shuttle2"
|
||||
@@ -239,7 +240,7 @@ area/space/atmosalert()
|
||||
|
||||
/area/shuttle/escape_pod5 //Pod 4 was lost to meteors
|
||||
name = "\improper Escape Pod Five"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/escape_pod5/station
|
||||
icon_state = "shuttle2"
|
||||
@@ -280,7 +281,7 @@ area/space/atmosalert()
|
||||
|
||||
/area/shuttle/specops/centcom
|
||||
name = "\improper Special Ops Shuttle"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
base_turf = /turf/unsimulated/floor
|
||||
icon_state = "shuttlered"
|
||||
centcomm_area = 1
|
||||
@@ -292,7 +293,7 @@ area/space/atmosalert()
|
||||
|
||||
/area/shuttle/syndicate_elite
|
||||
name = "\improper Merc Elite Shuttle"
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/syndicate_elite/mothership
|
||||
icon_state = "shuttlered"
|
||||
@@ -304,7 +305,7 @@ area/space/atmosalert()
|
||||
station_area = 1
|
||||
|
||||
/area/shuttle/administration
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
|
||||
/area/shuttle/administration/centcom
|
||||
name = "\improper Administration Shuttle Centcom"
|
||||
@@ -329,12 +330,6 @@ area/space/atmosalert()
|
||||
icon_state = "shuttle"
|
||||
station_area = 1
|
||||
|
||||
/area/airtunnel1/ // referenced in airtunnel.dm:759
|
||||
|
||||
/area/dummy/ // Referenced in engine.dm:261
|
||||
|
||||
// === end remove
|
||||
|
||||
// CENTCOM
|
||||
|
||||
/area/prison/solitary
|
||||
@@ -477,7 +472,7 @@ area/space/atmosalert()
|
||||
name = "\improper Independent Station"
|
||||
icon_state = "yellow"
|
||||
requires_power = 0
|
||||
flags = RAD_SHIELDED
|
||||
flags = RAD_SHIELDED | SPAWN_ROOF
|
||||
no_light_control = 1
|
||||
|
||||
/area/syndicate_station/start
|
||||
@@ -533,6 +528,7 @@ area/space/atmosalert()
|
||||
requires_power = 0
|
||||
no_light_control = 1
|
||||
base_turf = /turf/space
|
||||
flags = SPAWN_ROOF
|
||||
|
||||
/area/skipjack_station/start
|
||||
name = "\improper Skipjack"
|
||||
@@ -2129,10 +2125,10 @@ area/space/atmosalert()
|
||||
*/
|
||||
|
||||
// CENTCOM
|
||||
var/list/centcom_areas = list ()
|
||||
var/list/centcom_areas = list()
|
||||
|
||||
//SPACE STATION 13
|
||||
var/list/the_station_areas = list ()
|
||||
var/list/the_station_areas = list()
|
||||
|
||||
/area/beach
|
||||
name = "Keelin's private beach"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
var/global/global_uid = 0
|
||||
var/uid
|
||||
var/holomap_color // Color of this area on the holomap. Must be a hex color (as string) or null.
|
||||
var/no_roof
|
||||
|
||||
/area/Initialize(mapload)
|
||||
icon_state = "white"
|
||||
@@ -24,11 +23,12 @@
|
||||
luminosity = 0
|
||||
else
|
||||
luminosity = 1
|
||||
if(centcomm_area)
|
||||
centcom_areas |= src
|
||||
if(station_area)
|
||||
the_station_areas |= src
|
||||
|
||||
if(centcomm_area)
|
||||
centcom_areas[src] = TRUE
|
||||
|
||||
if(station_area)
|
||||
the_station_areas[src] = TRUE
|
||||
|
||||
if(!requires_power || !apc)
|
||||
power_light = 0
|
||||
@@ -36,9 +36,7 @@
|
||||
power_environ = 0
|
||||
|
||||
if (!mapload)
|
||||
power_change() // all machines set to current power level, also updates lighting icon
|
||||
|
||||
blend_mode = BLEND_MULTIPLY
|
||||
power_change() // all machines set to current power level
|
||||
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ var/global/list/base_turf_by_z = list(
|
||||
"3" = /turf/simulated/floor/asteroid,
|
||||
"4" = /turf/simulated/floor/asteroid,
|
||||
"5" = /turf/simulated/floor/asteroid,
|
||||
"6" = /turf/simulated/open,
|
||||
"6" = /turf/space,
|
||||
"7" = /turf/space,
|
||||
"8" = /turf/space,
|
||||
"9" = /turf/space
|
||||
|
||||
@@ -52,16 +52,20 @@
|
||||
if (smooth)
|
||||
queue_smooth(src)
|
||||
|
||||
if (light_power && light_range)
|
||||
if (light_range && light_power)
|
||||
update_light()
|
||||
|
||||
if (opacity)
|
||||
has_opaque_atom = TRUE
|
||||
|
||||
if(!baseturf)
|
||||
baseturf = get_base_turf_by_area(src)
|
||||
var/area/A = loc
|
||||
|
||||
spawn_roof()
|
||||
if(!baseturf)
|
||||
// Hard-coding this for performance reasons.
|
||||
baseturf = A.base_turf || base_turf_by_z["[z]"] || /turf/space
|
||||
|
||||
if (A.flags & SPAWN_ROOF)
|
||||
spawn_roof()
|
||||
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
|
||||
@@ -293,13 +297,11 @@ var/const/enterloopsanity = 100
|
||||
* @return TRUE if a roof has been spawned, FALSE if not.
|
||||
*/
|
||||
/turf/proc/spawn_roof(flags = 0)
|
||||
if (!HasAbove(z))
|
||||
var/turf/simulated/open/above = GetAbove(src)
|
||||
if (!above)
|
||||
return FALSE
|
||||
|
||||
var/turf/simulated/open/above = GetAbove(src)
|
||||
var/area/A = loc
|
||||
|
||||
if (((istype(above) && !A.no_roof) || (flags & ROOF_FORCE_SPAWN)) && roof_type && above)
|
||||
if (((istype(above)) || (flags & ROOF_FORCE_SPAWN)) && roof_type && above)
|
||||
above.ChangeTurf(roof_type)
|
||||
roof_flags |= flags
|
||||
return TRUE
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
requires_power = 0
|
||||
station_area = 1
|
||||
sound_env = SMALL_ENCLOSED
|
||||
no_roof = TRUE
|
||||
|
||||
var/lift_floor_label = null
|
||||
var/lift_floor_name = null
|
||||
|
||||
@@ -90,8 +90,6 @@ datum/unit_test/wire_test/start_test()
|
||||
var/list/dirs_checked = list()
|
||||
|
||||
for(C in world)
|
||||
T = null
|
||||
|
||||
T = get_turf(C)
|
||||
if(T && T.z in config.station_levels)
|
||||
cable_turfs |= get_turf(C)
|
||||
@@ -113,7 +111,35 @@ datum/unit_test/wire_test/start_test()
|
||||
pass("All \[[wire_test_count]\] wires had no overlapping cables going the same direction.")
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
/datum/unit_test/roof_test
|
||||
name = "MAP: Roof Test (Station)"
|
||||
|
||||
/datum/unit_test/roof_test/start_test()
|
||||
var/bad_tiles = 0
|
||||
var/tiles_total = 0
|
||||
var/turf/above
|
||||
var/area/A
|
||||
var/thing
|
||||
for (thing in the_station_areas)
|
||||
A = thing
|
||||
|
||||
for (var/turf/T in A) // Areas don't just contain turfs, so typed loop it is.
|
||||
T = thing
|
||||
tiles_total++
|
||||
above = GetAbove(T)
|
||||
|
||||
if (above && above.is_hole)
|
||||
bad_tiles++
|
||||
log_unit_test("[ascii_red]--------------- [T.name] \[[T.x] / [T.y] / [T.z]\] Has no roof.")
|
||||
|
||||
if (bad_tiles)
|
||||
fail("\[[bad_tiles] / [tiles_total]\] station turfs had no roof.")
|
||||
else
|
||||
pass("All \[[tiles_total]\] station turfs had a roof.")
|
||||
|
||||
return 1
|
||||
|
||||
#undef SUCCESS
|
||||
#undef FAILURE
|
||||
|
||||
Reference in New Issue
Block a user