Holodeck closet & crate items are marked as holograms (#84326)

## About The Pull Request
- Fixes #83834
- Fixes #74765

When a holographic closet/crate is opened for the 1st time all their
items are marked as holograms & get deleted when the simulation is
changed

## Changelog
🆑
fix: Holodeck closet & crate items are marked as holograms as well
fix: Holodeck closet & crate items delete themselves when the program is
changed
/🆑
This commit is contained in:
SyncIt21
2024-06-28 16:15:23 -06:00
committed by GitHub
parent f8711c4e56
commit 6d80956db1
5 changed files with 15 additions and 4 deletions
+10
View File
@@ -293,6 +293,8 @@ GLOBAL_LIST_INIT(typecache_holodeck_linked_floorcheck_ok, typecacheof(list(/turf
if(isstructure(holo_object))
holo_object.obj_flags |= NO_DEBRIS_AFTER_DECONSTRUCTION
if(istype(holo_object, /obj/structure/closet))
RegisterSignal(holo_object, COMSIG_CLOSET_CONTENTS_INITIALIZED, PROC_REF(register_contents))
return
if(ismachinery(holo_object))
@@ -304,6 +306,14 @@ GLOBAL_LIST_INIT(typecache_holodeck_linked_floorcheck_ok, typecacheof(list(/turf
var/obj/machinery/button/holo_button = holo_machine
holo_button.setup_device()
/obj/machinery/computer/holodeck/proc/register_contents(obj/structure/closet/storage)
SIGNAL_HANDLER
for(var/atom/movable/item as anything in storage.get_all_contents_type(/atom/movable))
if(item == storage)
continue
add_to_spawned(item)
/**
* A separate proc for objects that weren't loaded by the template nor spawned by holo effects
* yet need to be added to the list of spawned objects. (e.g. holographic fishes)