Stops shields getting broken by pillows and disablers. (#75759)

## About The Pull Request
See the title. Doing so by adding a new arg for damage type to
`check_shields()` and `hit_reaction()`. The other way would had involved
a couple istype checks for item or projectile damage type, but this is a
longer term solution and can tackle more than just that.

## Why It's Good For The Game
Fixes #74876.

## Changelog

🆑
fix: Stops shields getting broken by pillows and disablers.
/🆑
This commit is contained in:
Ghom
2023-06-01 22:26:10 +02:00
committed by GitHub
parent 099c804c52
commit 88b898dffd
32 changed files with 73 additions and 62 deletions
+11 -2
View File
@@ -128,8 +128,17 @@
qdel(shield)
UnregisterSignal(mod.wearer, COMSIG_HUMAN_CHECK_SHIELDS)
/obj/item/mod/module/energy_shield/proc/shield_reaction(mob/living/carbon/human/owner, atom/movable/hitby, damage = 0, attack_text = "the attack", attack_type = MELEE_ATTACK, armour_penetration = 0)
if(SEND_SIGNAL(mod, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, 0, damage, attack_type) & COMPONENT_HIT_REACTION_BLOCK)
/obj/item/mod/module/energy_shield/proc/shield_reaction(mob/living/carbon/human/owner,
atom/movable/hitby,
damage = 0,
attack_text = "the attack",
attack_type = MELEE_ATTACK,
armour_penetration = 0,
damage_type = BRUTE
)
SIGNAL_HANDLER
if(SEND_SIGNAL(mod, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, 0, damage, attack_type, damage_type) & COMPONENT_HIT_REACTION_BLOCK)
drain_power(use_power_cost)
return SHIELD_BLOCK
return NONE