From fdbef6a93c565c8257366dadcafbae10a0da9957 Mon Sep 17 00:00:00 2001
From: Ghom <42542238+Ghommie@users.noreply.github.com>
Date: Thu, 13 Feb 2020 13:10:36 +0100
Subject: [PATCH] Update bin.dm
---
code/modules/recycling/disposal/bin.dm | 36 +++++++-------------------
1 file changed, 10 insertions(+), 26 deletions(-)
diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm
index 90f96d0352..d39d9f4b85 100644
--- a/code/modules/recycling/disposal/bin.dm
+++ b/code/modules/recycling/disposal/bin.dm
@@ -79,12 +79,12 @@
/obj/machinery/disposal/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(!pressure_charging && !full_pressure && !flush)
- if(istype(I, /obj/item/screwdriver))
+ if(I.tool_behaviour == TOOL_SCREWDRIVER)
panel_open = !panel_open
I.play_tool_sound(src)
to_chat(user, "You [panel_open ? "remove":"attach"] the screws around the power connection.")
return
- else if(istype(I, /obj/item/weldingtool) && panel_open)
+ else if(I.tool_behaviour == TOOL_WELDER && panel_open)
if(!I.tool_start_check(user, amount=0))
return
@@ -99,7 +99,7 @@
return
place_item_in_disposal(I, user)
update_icon()
- return 1 //no afterattack
+ return TRUE //no afterattack
else
return ..()
@@ -288,32 +288,16 @@
var/datum/oracle_ui/themed/nano/ui
obj_flags = CAN_BE_HIT | USES_TGUI | SHOVABLE_ONTO
-
// attack by item places it in to disposal
/obj/machinery/disposal/bin/attackby(obj/item/I, mob/user, params)
- add_fingerprint(user)
- if(!pressure_charging && !full_pressure && !flush)
- if(I.tool_behaviour == TOOL_SCREWDRIVER)
- panel_open = !panel_open
- I.play_tool_sound(src)
- to_chat(user, "You [panel_open ? "remove":"attach"] the screws around the power connection.")
- return
- else if(I.tool_behaviour == TOOL_WELDER && panel_open)
- if(!I.tool_start_check(user, amount=0))
- return
-
- to_chat(user, "You start slicing the floorweld off \the [src]...")
- if(I.use_tool(src, user, 20, volume=100) && panel_open)
- to_chat(user, "You slice the floorweld off \the [src].")
- deconstruct()
- return
-
- if(user.a_intent != INTENT_HARM)
- if((I.item_flags & ABSTRACT) || !user.temporarilyRemoveItemFromInventory(I))
- return
- place_item_in_disposal(I, user)
+ if(istype(I, /obj/item/storage/bag/trash)) //Not doing component overrides because this is a specific type.
+ var/obj/item/storage/bag/trash/T = I
+ var/datum/component/storage/STR = T.GetComponent(/datum/component/storage)
+ to_chat(user, "You empty the bag.")
+ for(var/obj/item/O in T.contents)
+ STR.remove_from_storage(O,src)
+ T.update_icon()
update_icon()
- return TRUE //no afterattack
else
return ..()