mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Fixing issues with contents of some coded or mapped closets exceeding their storage capacity (#62221)
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
#include "card_mismatch.dm"
|
||||
#include "chain_pull_through_space.dm"
|
||||
#include "chat_filter.dm"
|
||||
#include "closets.dm"
|
||||
#include "combat.dm"
|
||||
#include "component_tests.dm"
|
||||
#include "connect_loc.dm"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/// Checks that the length of the initial contents of a closet doesn't exceed its storage capacity
|
||||
/datum/unit_test/closets
|
||||
|
||||
/datum/unit_test/closets/Run()
|
||||
var/list/all_closets = subtypesof(/obj/structure/closet)
|
||||
//Supply pods. They are sent, crashed, opened and never closed again. They also cause exceptions in nullspace.
|
||||
all_closets -= typesof(/obj/structure/closet/supplypod)
|
||||
|
||||
for(var/closet_type in all_closets)
|
||||
var/obj/structure/closet/closet = allocate(closet_type)
|
||||
var/contents_len = length(closet.contents)
|
||||
TEST_ASSERT(contents_len <= closet.storage_capacity, "Initial Contents of [closet.type] ([contents_len]) exceed its storage capacity ([closet.storage_capacity]).")
|
||||
Reference in New Issue
Block a user