From e72f7cf43635846e86d36751500790e4fc9d92b5 Mon Sep 17 00:00:00 2001 From: Francisco-Franks Date: Mon, 1 Apr 2024 13:56:00 -0700 Subject: [PATCH 1/2] Borgs can now get buff in the gym on the weight machines. --- code/obj/item/fitness.dm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/obj/item/fitness.dm b/code/obj/item/fitness.dm index 2169409accb48..d48c061249e8e 100644 --- a/code/obj/item/fitness.dm +++ b/code/obj/item/fitness.dm @@ -51,6 +51,15 @@ deconstruct_flags = DECON_WRENCH var/in_use = 0 + MouseDrop_T(var/mob/M, var/mob/user) + // Do not attempt to distantly pump iron. + if (BOUNDS_DIST(user, src) > 0) + return + // Do not attempt to pump iron at a distance. + if (BOUNDS_DIST(M, src) > 0) + return + src.attack_hand(M) + attack_hand(mob/user) if(in_use) boutput(user, SPAN_ALERT("Its already in use - wait a bit.")) @@ -99,6 +108,15 @@ deconstruct_flags = DECON_WRENCH var/in_use = 0 + MouseDrop_T(var/mob/M, var/mob/user) + // Do not attempt to distantly pump iron. + if (BOUNDS_DIST(user, src) > 0) + return + // Do not attempt to pump iron at a distance. + if (BOUNDS_DIST(M, src) > 0) + return + src.attack_hand(M) + attack_hand(mob/user) if(in_use) boutput(user, SPAN_ALERT("Its already in use - wait a bit.")) From 197ba0e11935af59531d2e8c9b82cc1acb5aff3e Mon Sep 17 00:00:00 2001 From: Francisco-Franks Date: Wed, 3 Apr 2024 10:30:55 -0700 Subject: [PATCH 2/2] Helpered --- code/obj/item/fitness.dm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/code/obj/item/fitness.dm b/code/obj/item/fitness.dm index d48c061249e8e..fa57aad4d67e2 100644 --- a/code/obj/item/fitness.dm +++ b/code/obj/item/fitness.dm @@ -53,10 +53,7 @@ MouseDrop_T(var/mob/M, var/mob/user) // Do not attempt to distantly pump iron. - if (BOUNDS_DIST(user, src) > 0) - return - // Do not attempt to pump iron at a distance. - if (BOUNDS_DIST(M, src) > 0) + if (!can_reach(user, src) || !can_reach(user, M)) return src.attack_hand(M) @@ -110,10 +107,7 @@ MouseDrop_T(var/mob/M, var/mob/user) // Do not attempt to distantly pump iron. - if (BOUNDS_DIST(user, src) > 0) - return - // Do not attempt to pump iron at a distance. - if (BOUNDS_DIST(M, src) > 0) + if (!can_reach(user, src) || !can_reach(user, M)) return src.attack_hand(M)