From 059dacc0dc88e1704a74de912847bb9adf60db39 Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 13 Jul 2024 22:23:45 +1000 Subject: [PATCH] Fixes some dex issues with food and natural weapons. --- code/_onclick/item_attack.dm | 9 +++++---- code/_onclick/other_mobs.dm | 2 +- code/modules/reagents/reagent_containers/food.dm | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 717de7a5e81..a5c912e0263 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -57,10 +57,11 @@ avoid code duplication. This includes items that may sometimes act as a standard /mob/living/attackby(obj/item/used_item, mob/user) if(!ismob(user)) return TRUE - if(can_operate(src, user) != OPERATE_DENY && used_item.do_surgery(src,user)) //Surgery - return TRUE - if(try_butcher_in_place(user, used_item)) - return TRUE + if(user.a_intent != I_HURT) + if(can_operate(src, user) != OPERATE_DENY && used_item.do_surgery(src,user)) //Surgery + return TRUE + if(try_butcher_in_place(user, used_item)) + return TRUE var/oldhealth = current_health . = used_item.use_on_mob(src, user) if(used_item.force && istype(ai) && current_health < oldhealth) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 6572f70b040..d25017d2426 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -74,11 +74,11 @@ if(.) return - a_intent = I_HURT var/attacking_with = get_natural_weapon() if(a_intent == I_HELP || !attacking_with) return A.attack_animal(src) + a_intent = I_HURT . = A.attackby(attacking_with, src) if(!.) reset_offsets(anim_time = 2) diff --git a/code/modules/reagents/reagent_containers/food.dm b/code/modules/reagents/reagent_containers/food.dm index 86f12dd5a0e..262ce0b4158 100644 --- a/code/modules/reagents/reagent_containers/food.dm +++ b/code/modules/reagents/reagent_containers/food.dm @@ -22,6 +22,7 @@ center_of_mass = @'{"x":16,"y":16}' w_class = ITEM_SIZE_SMALL abstract_type = /obj/item/chems/food + needs_attack_dexterity = DEXTERITY_NONE /// Indicates the food should give a stress effect on eating. // This is set to 1 if the food is created by a recipe, -1 if the food is raw.