From e918fd861026df2a3abaee4960b6a5afdc515c28 Mon Sep 17 00:00:00 2001 From: Alberyk Date: Mon, 15 Mar 2021 17:36:44 -0300 Subject: [PATCH] Fixes the rice bowl trash item (#11441) --- code/game/objects/items/trash.dm | 19 ++++++++++++------- .../reagent_containers/food/snacks.dm | 2 +- html/changelogs/alberyk-ricebowl.yml | 6 ++++++ 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 html/changelogs/alberyk-ricebowl.yml diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 2b994554431..ce38beea550 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -208,18 +208,23 @@ /obj/item/trash/ricetub name = "empty rice tub" icon_state = "ricetub" + var/has_chopsticks = FALSE /obj/item/trash/ricetub/attackby(obj/item/W, mob/living/user) if(istype(W, /obj/item/material/kitchen/utensil/fork/chopsticks)) - var/obj/item/trash/ricetub_s/T = new() to_chat(user, SPAN_NOTICE("You reattach the [W] to \the [src]")) - src.Destroy() - W.Destroy() - user.put_in_inactive_hand(T) //Because the chopsticks are in the active hand + qdel(W) + has_chopsticks = TRUE + update_icon() -/obj/item/trash/ricetub_s - name = "empty rice tub" - icon_state = "ricetub_s" +/obj/item/trash/ricetub/update_icon() + if(has_chopsticks) + icon_state = "ricetub_s" + else + icon_state = "ricetub" + +/obj/item/trash/ricetub/sticks + has_chopsticks = TRUE /obj/item/trash/seaweed name = "empty moss pack" diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 15c804a7a7e..aea5f751643 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -3681,7 +3681,7 @@ name = "packed rice bowl" desc = "Boiled rice packed in a sealed plastic tub with the Nojosuru Foods logo on it. There appears to be a pair of chopsticks clipped to the side." icon_state = "ricetub" - trash = /obj/item/trash/ricetub_s + trash = /obj/item/trash/ricetub/sticks filling_color = "#A66829" center_of_mass = list("x"=17, "y"=16) reagents_to_add = list(/decl/reagent/nutriment = 5) diff --git a/html/changelogs/alberyk-ricebowl.yml b/html/changelogs/alberyk-ricebowl.yml new file mode 100644 index 00000000000..9e7fd607167 --- /dev/null +++ b/html/changelogs/alberyk-ricebowl.yml @@ -0,0 +1,6 @@ +author: Alberyk + +delete-after: True + +changes: + - bugfix: "Fixed the rice bowl deleting itself."