Merge pull request #12944 from timothyteakettle/fixes-crates

fixes some crafted crates containing items
This commit is contained in:
Lin
2020-07-28 22:11:30 -05:00
committed by GitHub
3 changed files with 15 additions and 5 deletions
@@ -37,12 +37,13 @@
var/lock_in_use = FALSE //Someone is doing some stuff with the lock here, better not proceed further
var/eigen_teleport = FALSE //If the closet leads to Mr Tumnus.
var/obj/structure/closet/eigen_target //Where you go to.
var/should_populate_contents = TRUE
/obj/structure/closet/Initialize(mapload)
. = ..()
update_icon()
PopulateContents()
if(should_populate_contents)
PopulateContents()
if(mapload && !opened) // if closed, any item at the crate's loc is put in the contents
addtimer(CALLBACK(src, .proc/take_contents), 0)
if(secure)
@@ -142,6 +142,9 @@
desc = "A freezer containing packs of blood."
icon_state = "surgery"
/obj/structure/closet/crate/freezer/blood/fake
should_populate_contents = FALSE
/obj/structure/closet/crate/freezer/blood/PopulateContents()
. = ..()
new /obj/item/reagent_containers/blood(src)
@@ -162,6 +165,9 @@
name = "surplus prosthetic limbs"
desc = "A crate containing an assortment of cheap prosthetic limbs."
/obj/structure/closet/crate/freezer/surplus_limbs/fake
should_populate_contents = FALSE
/obj/structure/closet/crate/freezer/surplus_limbs/PopulateContents()
. = ..()
new /obj/item/bodypart/l_arm/robot/surplus(src)
@@ -196,6 +202,9 @@
name = "\improper RCD crate"
icon_state = "engi_crate"
/obj/structure/closet/crate/rcd/fake
should_populate_contents = FALSE
/obj/structure/closet/crate/rcd/PopulateContents()
..()
for(var/i in 1 to 4)