From f48fa66ccacbca6f839f0efb1130468354354c5f Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Thu, 7 Dec 2023 23:25:11 +0100 Subject: [PATCH] robots can use melee weapon range runtime fix in window.dm --- code/_onclick/cyborg.dm | 2 +- code/game/objects/structures/window.dm | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 213fe57b90e..a7ff03177d5 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -89,7 +89,7 @@ // cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc)) if(isturf(A) || isturf(A.loc)) - if(A.Adjacent(src)) // see adjacent.dm + if(A.Adjacent(src) || (W && W.attack_can_reach(src, A, W.reach))) // see adjacent.dm, allows robots to use ranged melee weapons var/resolved = A.attackby(W, src, 1) if(!resolved && A && W) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index e6ec740aa00..2260f42fb9f 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -185,22 +185,22 @@ user.do_attack_animation(src) shatter() - else if (usr.a_intent == I_HURT) + else if (user.a_intent == I_HURT) - if (istype(usr,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = usr + if (istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user if(H.species.can_shred(H)) attack_generic(H,25) return playsound(src, 'sound/effects/glassknock.ogg', 80, 1) user.do_attack_animation(src) - usr.visible_message("\The [usr] bangs against \the [src]!", + user.visible_message("\The [user] bangs against \the [src]!", "You bang against \the [src]!", "You hear a banging sound.") else playsound(src, 'sound/effects/glassknock.ogg', 80, 1) - usr.visible_message("[usr.name] knocks on the [src.name].", + user.visible_message("[user.name] knocks on the [src.name].", "You knock on the [src.name].", "You hear a knocking sound.") return