Skip to content

Commit

Permalink
Auto Delete Foodless MREs (#5761)
Browse files Browse the repository at this point in the history
# About the pull request

MRE's that contain no food will now be automatically deleted.

# Explain why it's good for the game

Current MRE's mean the FOB, and frontline where a resupply crate lands,
are littered with endless amounts of opened MRE's that are filled with
the fluff items. This not only clutters up the area but it means if you
are desperate for food, you have to search these half-used MRE's.

With this change, this means that a MRE on the ground will actually
contain food instead of matches or water, and this will significantly
declutter the FOB and frontline of food items.


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: MRE's will now auto-delete if they do not contain and food items
when they are discarded.
/:cl:

---------

Co-authored-by: Steelpoint <[email protected]>
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
3 people authored Apr 7, 2024
1 parent c69621c commit 362d19e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions code/game/objects/items/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,18 @@
. = ..()
isopened = 0
icon_state = "mealpack"
RegisterSignal(src, COMSIG_ITEM_DROPPED, PROC_REF(try_forced_folding))

/obj/item/storage/box/MRE/proc/try_forced_folding(datum/source, mob/user)
SIGNAL_HANDLER

if(locate(/obj/item/reagent_container/food/snacks/packaged_meal) in src)
return

UnregisterSignal(src, COMSIG_ITEM_DROPPED)
storage_close(user)
to_chat(user, SPAN_NOTICE("You throw away [src]."))
qdel(src)

/obj/item/storage/box/MRE/update_icon()
if(!contents.len)
Expand Down

0 comments on commit 362d19e

Please sign in to comment.