Fixes #1789 and most alt-clicking related bugs (#1808)

Fix for the alt-clicking related bugs; users being able to alt-click and
have it work regardless of distance.
This commit is contained in:
Ryan784
2017-02-24 12:30:09 -05:00
committed by skull132
parent 54b64c3688
commit a52092b294
10 changed files with 26 additions and 17 deletions

View File

@@ -183,12 +183,13 @@
user << "You turn the sign off." user << "You turn the sign off."
/obj/item/weapon/caution/AltClick() /obj/item/weapon/caution/AltClick()
if(src.icon_state == "caution") if(!usr || usr.stat || usr.lying || usr.restrained() || !Adjacent(usr)) return
src.icon_state = "caution_blinking" if(src.icon_state == "caution")
usr << "You turn the sign on." src.icon_state = "caution_blinking"
else usr << "You turn the sign on."
src.icon_state = "caution" else
usr << "You turn the sign off." src.icon_state = "caution"
usr << "You turn the sign off."
/obj/item/weapon/caution/cone /obj/item/weapon/caution/cone
desc = "This cone is trying to warn you of something!" desc = "This cone is trying to warn you of something!"

View File

@@ -26,7 +26,7 @@
set name = "Eject ID Card" set name = "Eject ID Card"
set src in oview(1) set src in oview(1)
if(!usr || usr.stat || usr.lying) return if(!usr || usr.stat || usr.lying || usr.restrained() || !Adjacent(usr)) return
if(scan) if(scan)
usr << "You remove \the [scan] from \the [src]." usr << "You remove \the [scan] from \the [src]."

View File

@@ -33,7 +33,7 @@
set name = "Eject ID Card" set name = "Eject ID Card"
set src in oview(1) set src in oview(1)
if(!usr || usr.stat || usr.lying) return if(!usr || usr.stat || usr.lying || usr.restrained() || !Adjacent(usr)) return
if(scan) if(scan)
usr << "You remove \the [scan] from \the [src]." usr << "You remove \the [scan] from \the [src]."

View File

@@ -42,7 +42,7 @@
set name = "Eject ID Card" set name = "Eject ID Card"
set src in oview(1) set src in oview(1)
if(!usr || usr.stat || usr.lying) return if(!usr || usr.stat || usr.lying || usr.restrained() || !Adjacent(usr)) return
if(scan) if(scan)
usr << "You remove \the [scan] from \the [src]." usr << "You remove \the [scan] from \the [src]."

View File

@@ -49,6 +49,7 @@
/obj/machinery/appliance/cooker/oven/AltClick(var/mob/user) /obj/machinery/appliance/cooker/oven/AltClick(var/mob/user)
if(user.stat || user.restrained()) return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)//No spamming the door, it makes a sound user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)//No spamming the door, it makes a sound
toggle_door() toggle_door()

View File

@@ -343,6 +343,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
return id return id
/obj/item/device/pda/AltClick(var/mob/user) /obj/item/device/pda/AltClick(var/mob/user)
if(!user || user.stat || user.lying || user.restrained() || !Adjacent(user)) return
if (ismob(src.loc)) if (ismob(src.loc))
verb_remove_id() verb_remove_id()

View File

@@ -48,6 +48,7 @@
//Altclick the cart with a mop to stow the mop away //Altclick the cart with a mop to stow the mop away
//Altclick the cart with a reagent container to pour things into the bucket without putting the bottle in trash //Altclick the cart with a reagent container to pour things into the bucket without putting the bottle in trash
/obj/structure/janitorialcart/AltClick() /obj/structure/janitorialcart/AltClick()
if(!usr || usr.stat || usr.lying || usr.restrained() || !Adjacent(usr)) return
var/obj/I = usr.get_active_hand() var/obj/I = usr.get_active_hand()
if(istype(I, /obj/item/weapon/mop)) if(istype(I, /obj/item/weapon/mop))
if(!mymop) if(!mymop)

View File

@@ -483,12 +483,15 @@ log transactions
// put the currently held id on the ground or in the hand of the user // put the currently held id on the ground or in the hand of the user
/obj/machinery/atm/proc/release_held_id(mob/living/carbon/human/human_user as mob) /obj/machinery/atm/proc/release_held_id(mob/living/carbon/human/human_user as mob)
if (!ishuman(human_user)) if (!ishuman(human_user))
return return
if(!held_card) if(!held_card)
return return
if(human_user.stat || human_user.lying || human_user.restrained() || !Adjacent(human_user)) return
held_card.loc = src.loc held_card.loc = src.loc
authenticated_account = null authenticated_account = null

View File

@@ -426,6 +426,7 @@
return return
/mob/living/silicon/pai/AltClick(mob/user as mob) /mob/living/silicon/pai/AltClick(mob/user as mob)
if(!user || user.stat || user.lying || user.restrained() || !Adjacent(user)) return
visible_message("<span class='danger'>[user.name] boops [src] on the head.</span>") visible_message("<span class='danger'>[user.name] boops [src] on the head.</span>")
close_up() close_up()

View File

@@ -23,6 +23,7 @@
src.verbs -= /obj/item/weapon/reagent_containers/verb/set_APTFT src.verbs -= /obj/item/weapon/reagent_containers/verb/set_APTFT
/obj/item/weapon/reagent_containers/spray/AltClick() /obj/item/weapon/reagent_containers/spray/AltClick()
if(!usr || usr.stat || usr.lying || usr.restrained() || !Adjacent(usr)) return
safety = !safety safety = !safety
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1) playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
usr << "<span class = 'notice'>You twist the locking cap on the end of the nozzle, the spraybottle is now [safety ? "locked" : "unlocked"].</span>" usr << "<span class = 'notice'>You twist the locking cap on the end of the nozzle, the spraybottle is now [safety ? "locked" : "unlocked"].</span>"