Skip to content

Commit

Permalink
[MIRROR] [NO GBP] Fixes deconstruction of closets & crates under a sp…
Browse files Browse the repository at this point in the history
…ecial case (#2924)

* [NO GBP] Fixes deconstruction of closets & crates under a special case (#82612)

## About The Pull Request
So if a closet/crate has the `NO_DEBRIS_AFTER_DECONSTRUCTION` set on it
and if someone/something is still inside, then after deconstruction they
get deleted rather than getting dumped out first.

Could cause potential hard delete of mobs & stuff. We don't want to deal
with that

## Changelog
:cl:
fix: closets & crates will dump all contents out first before deleting
itself regardless of `NO_DEBRIS_AFTER_DECONSTRUCTION` thus not for e.g.
hard deleting mobs inside it
/:cl:

* [NO GBP] Fixes deconstruction of closets & crates under a special case

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: SyncIt21 <[email protected]>
  • Loading branch information
3 people authored Apr 17, 2024
1 parent 2a807ed commit 3f57b86
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,11 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets)
else
return open(user)

/obj/structure/closet/atom_deconstruct(disassembled = TRUE)
/obj/structure/closet/handle_deconstruct(disassembled)
dump_contents()
if(obj_flags & NO_DEBRIS_AFTER_DECONSTRUCTION)
return

if(ispath(material_drop) && material_drop_amount)
new material_drop(loc, material_drop_amount)
if (secure)
Expand All @@ -592,7 +596,6 @@ GLOBAL_LIST_EMPTY(roundstart_station_closets)
electronics.accesses = req_access
if(card_reader_installed)
new /obj/item/stock_parts/card_reader(drop_location())
dump_contents()

/obj/structure/closet/atom_break(damage_flag)
. = ..()
Expand Down

0 comments on commit 3f57b86

Please sign in to comment.