mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
* Unit tests for stuff accidentally placed in space by mappers (#84453) This unit test detects all turfs & other movables that aren't in a lit area (ie area/space/nearspace) on station zlevels The grep detects movables placed on shuttles that do not have the correct area assigned, which caused those atoms to break off of the shuttle & literally get launched into random parts of space (usually on station z-levels; the only reason I found this issue was cause the unit test was detecting random shit ending up on station maps lol) Minor fix for the mapload_space_verification unit test - it was falsely detecting turfs that shuttle grids (that were template_noop) were parked ontop of, which aren't effected by the shuttle in any way. This allowed the following fix Fixed a number of shuttles having atoms in /area/template_noop areas. Atoms in these areas are treated as not actually part of the shuttle itself & were launched off into random space tiles across all z-levels via dump_in_space(). Corrected those grids to have the correct area, and as such, shuttles now stay together properly. 🆑 ShizCalev fix: Fixed a number of shuttles having parts (such as lattices) completely disappearing. fix: Fixed the ceilings above shuttles on station maps being full-bright. fix: Fixed lattices sometimes appearing at random locations in space on station maps. fix: Cleaned up a number of accidentally placed objects in space across all station maps. fix: Fixed a false positive with the mapload_space_verification unit test failing on turfs that weren't actually part of shuttles. code: Added a unit test that automatically finds all base space turfs with objects on them, as well as non-space turfs that are set to space areas (meaning that these squares weren't lit properly.) /🆑 Shuttle Ceiling Fix: Before  Fixed  Shuttle Fix: Before  Fixed (look at the lattices in the middle. the stuff in the shuttle are randomized / not part of this)  * Unit tests for stuff accidentally placed in space by mappers * Fixes maps for nearspace unit test (#28557) Fixes maps --------- Co-authored-by: Afevis <ShizCalev@users.noreply.github.com> Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com>
41 lines
2.3 KiB
Plaintext
41 lines
2.3 KiB
Plaintext
///Detects movables that may have been accidentally placed in space, as well as movables which do not have the proper nearspace area (meaning they aren't lit properly.)
|
|
/datum/unit_test/mapping_nearstation_test
|
|
priority = TEST_PRE
|
|
|
|
/datum/unit_test/mapping_nearstation_test/Run()
|
|
if(SSmapping.is_planetary())
|
|
return //No need to test for orphaned spaced atoms on this map.
|
|
|
|
var/list/safe_atoms = typecacheof(list(
|
|
/atom/movable/mirage_holder,
|
|
/obj/docking_port,
|
|
/obj/effect/landmark,
|
|
/obj/effect/abstract,
|
|
/obj/effect/mapping_error,
|
|
)) //Mapping stuff that we don't actually have to be concerned about.
|
|
var/list/safe_areas = typecacheof(list(
|
|
/area/misc/testroom,
|
|
/area/station/holodeck,
|
|
))
|
|
|
|
for(var/station_z in SSmapping.levels_by_trait(ZTRAIT_STATION))
|
|
var/list/turfs_to_check = Z_TURFS(station_z)
|
|
for(var/turf/station_turf as anything in turfs_to_check)
|
|
var/area/turf_area = station_turf.loc
|
|
if(turf_area.static_lighting || is_type_in_typecache(turf_area, safe_areas)) //Only care about turfs that don't have lighting enabled.
|
|
continue
|
|
var/has_thing = FALSE
|
|
for(var/atom/movable/thing_on_the_turf as anything in station_turf.contents) //Find an item on the turf, this can help the mapper identify the turf more easily when combined with the exact coords.
|
|
if(is_type_in_typecache(thing_on_the_turf, safe_atoms))
|
|
continue
|
|
TEST_FAIL("[station_turf.x], [station_turf.y], [station_turf.z]: [thing_on_the_turf.type] with area of type [turf_area.type]")
|
|
has_thing = TRUE
|
|
break
|
|
if(!has_thing && !isspaceturf(station_turf) && !istype(station_turf, /turf/open/openspace)) //In case it's just a turf without an area
|
|
if(istype(station_turf, /turf/open/floor/engine/hull/ceiling))
|
|
TEST_FAIL("[station_turf.x], [station_turf.y], [station_turf.z]: [station_turf.type] with area of type [turf_area.type]. The turf on the z-level below is a shuttle dock and generated me! An error landmark has been generated on the map for easier debugging!")
|
|
else
|
|
TEST_FAIL("[station_turf.x], [station_turf.y], [station_turf.z]: [station_turf.type] with area of type [turf_area.type]")
|
|
if(!succeeded)
|
|
TEST_FAIL("Movable Atom located without a proper area. Please verify they are supposed to be there. If they are correct, change the area to /area/space/nearstation (or the correct surrounding type).")
|