From 63546319375afa1dcf106a81a4ccb8465e3db5be Mon Sep 17 00:00:00 2001 From: Citinited Date: Sat, 1 Dec 2018 00:13:21 +0000 Subject: [PATCH] Fixes lots of items not being taped by duct tape; tape won't be applied to bags if it can be inserted --- code/datums/action.dm | 4 +++- code/game/objects/items.dm | 4 ++++ code/game/objects/items/weapons/RCL.dm | 1 + code/game/objects/items/weapons/tape.dm | 1 + code/game/objects/items/weapons/tools.dm | 1 + code/game/objects/items/weapons/twohanded.dm | 11 ++++++++--- code/modules/clothing/shoes/miscellaneous.dm | 4 +--- code/modules/food_and_drinks/drinks/drinks.dm | 2 ++ code/modules/food_and_drinks/food/condiment.dm | 6 ------ code/modules/food_and_drinks/food/snacks.dm | 4 +++- .../mob/living/carbon/human/human_movement.dm | 12 +++++++----- code/modules/paperwork/clipboard.dm | 2 ++ code/modules/paperwork/folders.dm | 5 +++-- code/modules/paperwork/paperbin.dm | 18 +++++++++--------- code/modules/power/cable.dm | 1 + .../reagent_containers/glass_containers.dm | 5 +++-- 16 files changed, 49 insertions(+), 32 deletions(-) diff --git a/code/datums/action.dm b/code/datums/action.dm index 2ae8e5f3eea..aba3e5aa82f 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -44,12 +44,14 @@ M.update_action_buttons() /datum/action/proc/Remove(mob/M) + owner = null + if(!M) + return if(M.client) M.client.screen -= button button.moved = FALSE //so the button appears in its normal position when given to another owner. M.actions -= src M.update_action_buttons() - owner = null /datum/action/proc/Trigger() if(!IsAvailable()) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 9f195470ebf..ba36bc0b199 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -311,6 +311,10 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d else if(S.can_be_inserted(src)) S.handle_item_insertion(src) else if(istype(I, /obj/item/stack/tape_roll)) + if(istype(src, /obj/item/storage)) //Don't tape the bag if we can put the duct tape inside it instead + var/obj/item/storage/bag = src + if(bag.can_be_inserted(I)) + return ..() var/obj/item/stack/tape_roll/TR = I var/list/clickparams = params2list(params) var/x_offset = text2num(clickparams["icon-x"]) diff --git a/code/game/objects/items/weapons/RCL.dm b/code/game/objects/items/weapons/RCL.dm index 86b4cc843ab..befe979078c 100644 --- a/code/game/objects/items/weapons/RCL.dm +++ b/code/game/objects/items/weapons/RCL.dm @@ -85,6 +85,7 @@ else icon_state = "rcl-0" item_state = "rcl-0" + ..() /obj/item/twohanded/rcl/proc/is_empty(mob/user, loud = 1) update_icon() diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm index 838734fc778..7084fdbc163 100644 --- a/code/game/objects/items/weapons/tape.dm +++ b/code/game/objects/items/weapons/tape.dm @@ -54,3 +54,4 @@ icon_state = "taperoll-4" else icon_state = "taperoll-4" + ..() diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index cbaa4cff554..22c4390110e 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -368,6 +368,7 @@ else icon_state = "[initial(icon_state)][ratio]" update_torch() + ..() /obj/item/weldingtool/process() switch(welding) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 9418df86368..1ffcc13207f 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -91,9 +91,6 @@ O.unwield(user) return unwield(user) -/obj/item/twohanded/update_icon() - return - /obj/item/twohanded/attack_self(mob/user) ..() if(wielded) //Trying to unwield it @@ -182,6 +179,7 @@ /obj/item/twohanded/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons. icon_state = "fireaxe[wielded]" + ..() /obj/item/twohanded/fireaxe/afterattack(atom/A, mob/user, proximity) if(!proximity) @@ -232,6 +230,7 @@ else icon_state = "dualsaber0" set_light(0) + ..() /obj/item/twohanded/dualsaber/attack(mob/target, mob/living/user) if(HULK in user.mutations) @@ -327,6 +326,7 @@ icon_state = "spearbomb[wielded]" else icon_state = "spearglass[wielded]" + ..() /obj/item/twohanded/spear/afterattack(atom/movable/AM, mob/user, proximity) if(!proximity) @@ -509,6 +509,7 @@ icon_state = "chainsaw[wielded]" else icon_state = "chainsaw0" + ..() /obj/item/twohanded/chainsaw/attack(mob/target, mob/living/user) if(wielded) @@ -565,6 +566,7 @@ /obj/item/twohanded/singularityhammer/update_icon() //Currently only here to fuck with the on-mob icons. icon_state = "mjollnir[wielded]" + ..() /obj/item/twohanded/singularityhammer/proc/vortex(turf/pull, mob/wielder) for(var/atom/movable/X in orange(5, pull)) @@ -640,6 +642,7 @@ /obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons. icon_state = "mjollnir[wielded]" + ..() /obj/item/twohanded/knighthammer name = "singuloth knight's hammer" @@ -670,6 +673,7 @@ /obj/item/twohanded/knighthammer/update_icon() //Currently only here to fuck with the on-mob icons. icon_state = "knighthammer[wielded]" + ..() /obj/item/twohanded/knighthammer/afterattack(atom/A, mob/user, proximity) if(!proximity) @@ -725,6 +729,7 @@ icon_state = "fireaxe2" else icon_state = "fireaxe0" + ..() /obj/item/twohanded/energizedfireaxe/afterattack(atom/A, mob/user, proximity) if(!proximity) diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index f73c04b72f3..607b67ccfb4 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -79,7 +79,6 @@ slowdown = SHOES_SLOWDOWN+1 item_color = "clown" var/footstep = 1 //used for squeeks whilst walking - silence_steps = 1 shoe_sound = "clownstep" /obj/item/clothing/shoes/jackboots @@ -93,7 +92,6 @@ put_on_delay = 50 burn_state = FIRE_PROOF var/footstep = 1 - silence_steps = 1 shoe_sound = "jackboot" /obj/item/clothing/shoes/jackboots/jacksandals @@ -185,7 +183,7 @@ if(istype(I, /obj/item/stack/tape_roll) && !silence_steps) var/obj/item/stack/tape_roll/TR = I if((!silence_steps || shoe_sound) && TR.use(4)) - silence_steps = 1 + silence_steps = TRUE shoe_sound = null to_chat(user, "You tape the soles of [src] to silence your footsteps.") else diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index b72ddea8be1..3ab7fb61bab 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -114,6 +114,8 @@ reagents.chem_temp += 15 to_chat(user, "You heat [src] with [I].") reagents.handle_reactions() + else + return ..() /obj/item/reagent_containers/food/drinks/examine(mob/user) if(!..(user, 1)) diff --git a/code/modules/food_and_drinks/food/condiment.dm b/code/modules/food_and_drinks/food/condiment.dm index 60642cab847..64a585e9051 100644 --- a/code/modules/food_and_drinks/food/condiment.dm +++ b/code/modules/food_and_drinks/food/condiment.dm @@ -26,9 +26,6 @@ "sugar" = list("emptycondiment", "sugar bottle", "Tasty spacey sugar!")) var/originalname = "condiment" //Can't use initial(name) for this. This stores the name set by condimasters. -/obj/item/reagent_containers/food/condiment/attackby(obj/item/W, mob/user, params) - return - /obj/item/reagent_containers/food/condiment/attack_self(mob/user) return @@ -55,9 +52,6 @@ playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) return 1 -/obj/item/reagent_containers/food/condiment/attackby(obj/item/I, mob/user, params) - return - /obj/item/reagent_containers/food/condiment/afterattack(obj/target, mob/user , proximity) if(!proximity) return diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index d9b6c6694a7..bb857969d5c 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -79,7 +79,7 @@ if(istype(W,/obj/item/storage)) ..() // -> item/attackby(, params) - if(istype(W,/obj/item/kitchen/utensil)) + else if(istype(W,/obj/item/kitchen/utensil)) var/obj/item/kitchen/utensil/U = W @@ -116,6 +116,8 @@ TrashItem.forceMove(loc) qdel(src) return TRUE + else + return ..() /obj/item/reagent_containers/food/snacks/proc/generate_trash(atom/location) if(trash) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 71a5f0396a1..33e855ab4d1 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -85,6 +85,13 @@ if(!(step_count % 2)) //every other turf makes a sound return 0 + if(istype(shoes, /obj/item/clothing/shoes)) + var/obj/item/clothing/shoes/shooess = shoes + if(shooess.silence_steps) + return 0 //silent + if(shooess.shoe_sound) + return //Handle it on the shoe + var/range = -(world.view - 2) if(m_intent == MOVE_INTENT_WALK) range -= 0.333 @@ -104,11 +111,6 @@ if(!shoes) volume -= 4 - if(istype(shoes, /obj/item/clothing/shoes)) - var/obj/item/clothing/shoes/shooess = shoes - if(shooess.silence_steps) - return 0 //silent - if(!has_organ("l_foot") && !has_organ("r_foot")) return 0 //no feet no footsteps diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index dc0b818fe92..e1ae7da26f5 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -114,6 +114,8 @@ obj/item/clipboard/proc/penPlacement(mob/user, obj/item/pen/P, placing) else if(istype(W, /obj/item/stamp) && toppaper) //We can stamp the topmost piece of paper toppaper.attackby(W, user) update_icon() + else + return ..() /obj/item/clipboard/attack_self(mob/user) showClipboard(user) diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 44eb3555a25..8c188952406 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -27,7 +27,7 @@ overlays.Cut() if(contents.len) overlays += "folder_paper" - return + ..() /obj/item/folder/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/paper) || istype(W, /obj/item/photo) || istype(W, /obj/item/paper_bundle) || istype(W, /obj/item/documents)) @@ -43,7 +43,8 @@ if((loc == usr || Adjacent(usr)) && usr.stat == 0) name = "folder[(n_name ? text("- '[n_name]'") : null)]" - return + else + return ..() /obj/item/folder/attack_self(mob/user as mob) var/dat = "[name]" diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 586138f1845..9f8d2335a9e 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -87,14 +87,14 @@ /obj/item/paper_bin/attackby(obj/item/paper/i as obj, mob/user as mob, params) - if(!istype(i)) - return - - user.drop_item() - i.loc = src - to_chat(user, "You put [i] in [src].") - papers.Add(i) - amount++ + if(istype(i)) + user.drop_item() + i.loc = src + to_chat(user, "You put [i] in [src].") + papers.Add(i) + amount++ + else + return ..() /obj/item/paper_bin/examine(mob/user) @@ -110,7 +110,7 @@ icon_state = "paper_bin0" else icon_state = "paper_bin1" - + ..() /obj/item/paper_bin/carbon name = "carbonless paper bin" diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 048cbf65500..d2720e28bd8 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -589,6 +589,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list( else icon_state = "coil" name = "cable coil" + ..() /obj/item/stack/cable_coil/proc/update_wclass() if(amount == 1) diff --git a/code/modules/reagents/reagent_containers/glass_containers.dm b/code/modules/reagents/reagent_containers/glass_containers.dm index e82dbda249d..9ea2c25903b 100644 --- a/code/modules/reagents/reagent_containers/glass_containers.dm +++ b/code/modules/reagents/reagent_containers/glass_containers.dm @@ -148,8 +148,8 @@ to_chat(user, "You set the label to \"[tmp_label]\".") label_text = tmp_label update_name_label() - if(istype(I,/obj/item/storage/bag)) - ..() + else + return ..() /obj/item/reagent_containers/glass/proc/update_name_label() if(label_text == "") @@ -201,6 +201,7 @@ overlays += lid if(assembly) overlays += "assembly" + ..() /obj/item/reagent_containers/glass/beaker/verb/remove_assembly() set name = "Remove Assembly"