mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
[MIRROR] Adds a unit test for dupe planes [MDB IGNORE] (#16489)
* Adds a unit test for dupe planes (#70129) * Adds a unit test for dupe planes Co-authored-by: Time-Green <timkoster1@hotmail.com> Co-authored-by: Tastyfish <crazychris32@gmail.com>
This commit is contained in:
co-authored by
Time-Green
Tastyfish
parent
543d7437dd
commit
55fb2abc7e
@@ -130,6 +130,7 @@
|
||||
#include "outfit_sanity.dm"
|
||||
#include "paintings.dm"
|
||||
#include "pills.dm"
|
||||
#include "plane_dupe_detector.dm"
|
||||
#include "plantgrowth_tests.dm"
|
||||
#include "preference_species.dm"
|
||||
#include "preferences.dm"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
///Checks if we don't have two planes on the same layer
|
||||
/datum/unit_test/plane_dupe_detector
|
||||
|
||||
/datum/unit_test/plane_dupe_detector/Run()
|
||||
var/list/plane_integer_list = list()
|
||||
for(var/atom/movable/screen/plane_master/plane_path as anything in subtypesof(/atom/movable/screen/plane_master))
|
||||
if(!initial(plane_path.plane))
|
||||
continue
|
||||
if(plane_integer_list.Find("[initial(plane_path.plane)]"))
|
||||
var/atom/movable/screen/plane_master/duplicate_plane_path = plane_integer_list["[initial(plane_path.plane)]"]
|
||||
TEST_FAIL("PLANE CONFLICT DETECTED!! The [initial(plane_path.name)] and [initial(duplicate_plane_path.name)] both use plane [initial(plane_path.plane)].")
|
||||
plane_integer_list["[initial(plane_path.plane)]"] = plane_path
|
||||
Reference in New Issue
Block a user