From 99eb77c0529573f240b60afb0041831ec34d8680 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Thu, 23 Jul 2020 09:32:28 -0700 Subject: [PATCH] fix --- code/_onclick/click.dm | 8 ++++---- code/_onclick/cyborg.dm | 6 ++---- code/_onclick/other_mobs.dm | 5 +++-- code/_onclick/right_click.dm | 13 ++++++------- code/modules/mob/clickdelay.dm | 4 ++-- code/modules/mob/living/living.dm | 2 +- code/modules/mob/mob_defines.dm | 1 + 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 138a61e4d9..fd969ddbd7 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -111,9 +111,9 @@ if(A in DirectAccess()) if(W) . = W.melee_attack_chain(src, A, params) - . = !(. & DISCARD_LAST_ACTION) + return = !(. & DISCARD_LAST_ACTION) else - . = UnarmedAttack(A)? TRUE : FALSE + return UnarmedAttack(A)? TRUE : FALSE //Can't reach anything else in lockers or other weirdness if(!loc.AllowClick()) @@ -123,9 +123,9 @@ if(CanReach(A,W)) if(W) . = W.melee_attack_chain(src, A, params) - . = !(. & DISCARD_LAST_ACTION) + return !(. & DISCARD_LAST_ACTION) else - . = UnarmedAttack(A, 1)? TRUE : FALSE + return UnarmedAttack(A, 1)? TRUE : FALSE else if(W) W.ranged_attack_chain(src, A, params) diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 4e6730ac35..ee30788b0d 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -79,8 +79,7 @@ // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents) if(A == loc || (A in loc) || (A in contents)) . = W.melee_attack_chain(src, A, params) - . = !(. & DISCARD_LAST_ACTION) - return + return !(. & DISCARD_LAST_ACTION) if(!isturf(loc)) return @@ -89,8 +88,7 @@ if(isturf(A) || isturf(A.loc)) if(A.Adjacent(src)) // see adjacent.dm . = W.melee_attack_chain(src, A, params) - . = !(. & DISCARD_LAST_ACTION) - return + return !(. & DISCARD_LAST_ACTION) else W.afterattack(A, src, 0, params) return diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index c35158046e..773a4475dd 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -14,7 +14,7 @@ // If the gloves do anything, have them return 1 to stop // normal attack_hand() here. var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines - if(proximity && istype(G) && G.Touch(A,1)) + if(proximity && istype(G) && (. = G.Touch(A,1))) return var/override = 0 @@ -26,7 +26,7 @@ return SEND_SIGNAL(src, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, A) - A.attack_hand(src, intent, flags) + return A.attack_hand(src, intent, flags) /atom/proc/attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) if(!(interaction_flags_atom & INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND)) @@ -39,6 +39,7 @@ on_attack_hand(user, act_intent, unarmed_attack_flags) if(attack_hand_unwieldlyness) user.DelayNextAction(attack_hand_unwieldlyness, considered_action = attack_hand_is_action) + return attack_hand_is_action /atom/proc/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) if(interaction_flags_atom & INTERACT_ATOM_ATTACK_HAND) diff --git a/code/_onclick/right_click.dm b/code/_onclick/right_click.dm index cb81c3998e..481bac446a 100644 --- a/code/_onclick/right_click.dm +++ b/code/_onclick/right_click.dm @@ -36,12 +36,11 @@ //User itself, current loc, and user inventory if(A in DirectAccess()) if(W) - . = W.rightclick_melee_attack_chain(src, A, params) - . = !(. & DISCARD_LAST_ACTION) + . = W.melee_attack_chain(src, A, params) + return !(. & DISCARD_LAST_ACTION) else if(!AltUnarmedAttack(A)) - . = UnarmedAttack(A, 1)? TRUE : FALSE - return + return UnarmedAttack(A, 1)? TRUE : FALSE //Can't reach anything else in lockers or other weirdness if(!loc.AllowClick()) @@ -50,11 +49,11 @@ //Standard reach turf to turf or reaching inside storage if(CanReach(A,W)) if(W) - . = W.rightclick_melee_attack_chain(src, A, params) - . = !(. & DISCARD_LAST_ACTION) + . = W.melee_attack_chain(src, A, params) + return !(. & DISCARD_LAST_ACTION) else if(!AltUnarmedAttack(A,1)) - . = UnarmedAttack(A, 1)? TRUE : FALSE + return UnarmedAttack(A, 1)? TRUE : FALSE else if(W) if(!W.altafterattack(A, src, FALSE, params)) diff --git a/code/modules/mob/clickdelay.dm b/code/modules/mob/clickdelay.dm index 640acbd2a4..f55bd13205 100644 --- a/code/modules/mob/clickdelay.dm +++ b/code/modules/mob/clickdelay.dm @@ -144,7 +144,7 @@ var/attack_hand_speed = CLICK_CD_MELEE /// Amount of time to hard stagger (no clicking at all) the mob post attack_hand(). Lower = better var/attack_hand_unwieldlyness = 0 - /// Should we set last action for attack hand? + /// Should we set last action for attack hand? This implies that attack_hands to this atom should flush to clickdelay buffers instead of discarding. var/attack_hand_is_action = FALSE /obj/item @@ -170,7 +170,7 @@ * Called after a successful attack to set a mob's clickdelay. */ /obj/item/proc/ApplyAttackCooldown(mob/user, atom/target) - user.DelayNextAction(attack_unwieldlyness, clickdelay_mod_bypass, FALSE) + user.DelayNextAction(attack_unwieldlyness, clickdelay_mod_bypass) /** * Get estimated time that a user has to not attack for to use us diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e7e01b438d..4559a48ac6 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -676,7 +676,7 @@ ..(pressure_difference, direction, pressure_resistance_prob_delta) /mob/living/can_resist() - return !(CheckResistCooldown() || !CHECK_MOBILITY(src, MOBILITY_RESIST)) + return !CheckResistCooldown() && CHECK_MOBILITY(src, MOBILITY_RESIST) /// Resist verb for attempting to get out of whatever is restraining your motion. Gives you resist clickdelay if do_resist() returns true. /mob/living/verb/resist() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index f5c236f9a8..0d4b3830a7 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -14,6 +14,7 @@ attack_hand_is_action = TRUE attack_hand_unwieldlyness = CLICK_CD_MELEE + attack_hand_speed = 0 /// What receives our keyboard input. src by default. var/datum/focus