From 4268b178c4bd0771e18305357fbd678ef8ea4669 Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Wed, 21 Jun 2023 18:19:18 -0400 Subject: [PATCH] boooooooooooks (#21379) --- code/modules/library/library_equipment.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/modules/library/library_equipment.dm b/code/modules/library/library_equipment.dm index e840df5608c..b2ff2ce8493 100644 --- a/code/modules/library/library_equipment.dm +++ b/code/modules/library/library_equipment.dm @@ -19,6 +19,18 @@ armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 50, ACID = 0) var/list/allowed_books = list(/obj/item/book, /obj/item/spellbook, /obj/item/storage/bible, /obj/item/tome) //Things allowed in the bookcase +/obj/structure/bookcase/Initialize(mapload) + . = ..() + if(mapload) + // same reasoning as closets + addtimer(CALLBACK(src, PROC_REF(take_contents)), 0) + +/obj/structure/bookcase/proc/take_contents() + for(var/obj/item/I in get_turf(src)) + if(is_type_in_list(I, allowed_books)) + I.forceMove(src) + update_icon(UPDATE_ICON_STATE) + /obj/structure/bookcase/attackby(obj/item/O, mob/user) if(is_type_in_list(O, allowed_books)) if(!user.drop_item())