refactoring altclick interaction to allow parent calls without forcing the turf contents stat menu open.
This commit is contained in:
@@ -207,8 +207,10 @@
|
||||
var/mob/M = loc
|
||||
M.update_inv_hands()
|
||||
/obj/item/gun/ballistic/automatic/AM4B/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!in_range(src, user)) //Basic checks to prevent abuse
|
||||
return
|
||||
. = TRUE
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
@@ -217,6 +219,7 @@
|
||||
if(body_color_input)
|
||||
body_color = sanitize_hexcolor(body_color_input, desired_format=6, include_crunch=1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/gun/ballistic/automatic/AM4B/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to recolor it.</span>"
|
||||
|
||||
@@ -30,8 +30,10 @@ obj/item/gun/energy/e_gun/cx/update_icon()
|
||||
M.update_inv_hands()
|
||||
|
||||
obj/item/gun/energy/e_gun/cx/AltClick(mob/living/user)
|
||||
. = ..()
|
||||
if(!in_range(src, user)) //Basic checks to prevent abuse
|
||||
return
|
||||
. = TRUE
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
|
||||
@@ -83,15 +83,17 @@
|
||||
return 1
|
||||
|
||||
/obj/item/gun/energy/pumpaction/AltClick(mob/living/user) //for changing firing modes since attackself is already used for pumping
|
||||
. = ..()
|
||||
if(!in_range(src, user)) //Basic checks to prevent abuse
|
||||
return
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
|
||||
if(ammo_type.len > 1)
|
||||
select_fire(user)
|
||||
update_icon()
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
else
|
||||
select_fire(user)
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/item/gun/energy/pumpaction/examine(mob/user) //so people don't ask HOW TO CHANGE FIRING MODE
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user