Fixes energy shields and energy swords blocking everything regardless of block chance. (#21278)

1. When a human is hit by a bullet, check_shields() is called. If a
value different from BULLET_ACT_HIT is returned, the shield will void
the bullet.
2. In turn, check_shield() calls handle_shield() on the held shield.
3. whoever coded this shit forgot to add a default return value so the
held shield returns null when it fails to block meaning that the game
voids the bullet lol

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2025-08-30 22:11:46 +00:00
committed by GitHub
co-authored by Matt Atlas
parent ed76c7ea3e
commit b9afbeb674
3 changed files with 62 additions and 1 deletions
@@ -118,6 +118,8 @@
if(prob(reflectchance))
user.visible_message(SPAN_DANGER("\The [user] blocks [attack_text] with \the [src]!"))
return BULLET_ACT_BLOCK
else
return BULLET_ACT_HIT
/obj/item/melee/energy/get_print_info()
. = ..()
+2 -1
View File
@@ -221,7 +221,8 @@
else
user.visible_message(SPAN_DANGER("\The [user] blocks [attack_text] with \the [src]!"))
return BULLET_ACT_BLOCK
else
return BULLET_ACT_HIT
/obj/item/shield/energy/get_block_chance(mob/user, damage, atom/damage_source = null, mob/attacker = null)
if(isprojectile(damage_source))