click fixes (#18987)

right click fixes
This commit is contained in:
Cameron Lennox
2026-01-05 20:17:44 +01:00
committed by GitHub
parent c6c07dd5ef
commit 233b582c74
4 changed files with 31 additions and 18 deletions
+11 -5
View File
@@ -84,7 +84,7 @@
CtrlClickOn(A)
return
//Replaces thee old 'stat||paralysis||stunned' check
//Replaces the old 'stat||paralysis||stunned' check
//Not fully implemented yet.
if(INCAPACITATED_IGNORING(src, INCAPABLE_RESTRAINTS|INCAPABLE_STASIS))
return
@@ -118,10 +118,16 @@
var/obj/item/W = get_active_hand()
if(!currently_restrained && W == A) // Handle attack_self
W.attack_self(src)
trigger_aiming(TARGET_CAN_CLICK)
update_inv_active_hand(0)
return 1
if(LAZYACCESS(modifiers, RIGHT_CLICK))
W.attack_self_secondary(src, modifiers)
trigger_aiming(TARGET_CAN_CLICK)
update_inv_active_hand(0)
return TRUE
else
W.attack_self(src, modifiers)
trigger_aiming(TARGET_CAN_CLICK)
update_inv_active_hand(0)
return TRUE
//Atoms on your person
// A is your location but is not a turf; or is on you (backpack); or is on something on you (box in backpack); sdepth is needed here because contents depth does not equate inventory storage depth.
+1 -1
View File
@@ -26,7 +26,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
* returns TRUE if the attack was handled by a signal handler and no further processing should occur.
* returns FALSE if a signal handler did NOT handle it, resulting in the normal chain.
*/
/obj/item/proc/attack_self(mob/user)
/obj/item/proc/attack_self(mob/user, modifiers)
SHOULD_CALL_PARENT(TRUE)
if(!user)
CRASH("attack_self was called without a user!")
+3
View File
@@ -149,6 +149,9 @@
if(.)
return TRUE
var/turf/T = get_turf(user)
if(!T)
to_chat(user, span_warning("You must be standing on solid ground to deploy an extraction beacon!"))
return
if(do_after(user, 1.5 SECONDS, target = user) && !QDELETED(src))
new /obj/structure/extraction_point(get_turf(user))
qdel(src)
+16 -12
View File
@@ -153,23 +153,27 @@
set category = "Object"
set src = usr
if(ismecha(loc))
return
if(INCAPACITATED_IGNORING(src, INCAPABLE_GRAB))
return
if(stat || paralysis || stunned)
return
if(restrained())
return
if(!checkClickCooldown())
return
setClickCooldown(1)
if(istype(loc,/obj/mecha)) return
if(hand)
var/obj/item/W = l_hand
if (W)
W.attack_self(src)
update_inv_l_hand()
else
var/obj/item/W = r_hand
if (W)
W.attack_self(src)
update_inv_r_hand()
var/obj/item/inhand = get_active_hand()
if(inhand)
inhand.attack_self(src)
update_inv_active_hand()
return
/mob/living/abiotic(var/full_body = 0)