Files
Aurora.3/code/modules/projectiles/targeting/targeting_triggers.dm
Lohikar a15aa07307 Fix Phantom Globals (#4957)
Removes the phantom global definitions that Fowl found.

Fixes:

Game log in GELF not logging proper target.
Pylon attacks not detecting the actual firer of a damaging bullet.
A message in the mixer cooking machine.
A message in airbubbles.
A use_check sanity check in landmines.
Some messages in psych therapy code.
A view() checkk in psych therapy code.
CCIA being unable to announce incoming faxes in some circumstances.
Language whitelists potentially checking the whitelists of the last person to throw a tray in addition to the pref mob.
Fixes some messages/sounds with some custom items.
Fixes a message with digging into the asteroid.
Fixes electrocution code not properly checking for absurdly long hair.
Fixes a broken message in devour.
Fixes a targeting issue with player-controlled hostile ranged mobs.
Fixes failure behavior for modular RnD guns.
Fixes an intent safety check on gun aim.
Fixes the Harvester knock spell potentially not working.
2018-07-01 22:47:58 +03:00

35 lines
1.1 KiB
Plaintext

/mob/living/proc/trigger_aiming(var/trigger_type)
if(!aimed.len)
return
for(var/obj/aiming_overlay/AO in aimed)
if(AO.aiming_at == src)
AO.update_aiming()
if(AO.aiming_at == src)
AO.trigger(trigger_type)
AO.update_aiming_deferred()
/obj/aiming_overlay/proc/trigger(var/perm)
if(owner && owner.client && (owner.client.prefs.toggles_secondary & SAFETY_CHECK) && owner.a_intent != I_HURT) //Check this first to save time.
owner << "You refrain from firing, as you aren't on harm intent."
return
if(!owner || !aiming_with || !aiming_at || !locked)
return
if(perm && (target_permissions & perm))
return
if(!owner.canClick())
return
owner.setClickCooldown(5) // Spam prevention, essentially.
owner.visible_message("<span class='danger'>\The [owner] pulls the trigger reflexively!</span>")
var/obj/item/weapon/gun/G = aiming_with
if(istype(G))
G.Fire(aiming_at, owner)
cancel_aiming()//if you can't remove it, nerf it
aim_cooldown(3)
toggle_active()
if (owner.client)
owner.client.remove_gun_icons()
/mob/living/ClickOn(var/atom/A, var/params)
. = ..()
trigger_aiming(TARGET_CAN_CLICK)