Ensures that components can stop attack_self() proc code from running on energy guns if it would return COMSIG_CANCEL_ATTACK_CHAIN (#92019)

## About The Pull Request

What it says on the tin.

## Why It's Good For The Game

Should a component potentially want to override the behaviour of energy
guns attack_self() proc, it will not be able to prevent this code from
running without this check.
This commit is contained in:
necromanceranne
2025-07-19 01:41:20 -05:00
committed by GitHub
parent 8ed81dee41
commit 320185d1a4
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -43,6 +43,7 @@
SIGNAL_HANDLER
INVOKE_ASYNC(src, PROC_REF(crank), source, user) //game doesnt like signal handler and do afters mingling
return COMPONENT_CANCEL_ATTACK_CHAIN
/datum/component/crank_recharge/proc/crank(obj/source, mob/user)
if(charging_cell.charge >= charging_cell.maxcharge)
+4 -1
View File
@@ -179,9 +179,12 @@
update_appearance()
/obj/item/gun/energy/attack_self(mob/living/user as mob)
. = ..()
if(.)
return
if(ammo_type.len > 1 && can_select)
select_fire(user)
return ..()
/obj/item/gun/energy/can_shoot()
var/obj/item/ammo_casing/energy/shot = ammo_type[select]