Fix armor penetration increasing negative object's and mob silicon's armor (#30105)

* fix

* no src allowed
This commit is contained in:
kyunkyunkyun
2025-09-07 11:34:29 +00:00
committed by GitHub
parent 8851f9b0ef
commit 11962e1b94
2 changed files with 11 additions and 12 deletions
@@ -312,12 +312,12 @@
/mob/living/silicon/proc/run_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armor_penetration_flat = 0, armor_penetration_percentage = 0)
if(damage_type != BRUTE && damage_type != BURN)
return 0
var/armor_protection = 0
var/armor_protection
if(damage_flag)
armor_protection = armor.getRating(damage_flag)
if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
armor_protection = clamp((armor_protection * ((100 - armor_penetration_percentage) / 100)) - armor_penetration_flat, min(armor_protection, 0), 100)
return round(damage_amount * (100 - armor_protection) * 0.01, DAMAGE_PRECISION)
if(armor_protection > 0) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
armor_protection = clamp(armor_protection * (100 - armor_penetration_percentage) / 100 - armor_penetration_flat, 0, 100)
return round(damage_amount * (100 - armor_protection) / 100, DAMAGE_PRECISION)
/mob/living/silicon/apply_effect(effect = 0, effecttype = STUN, blocked = 0)
return FALSE //The only effect that can hit them atm is flashes and they still directly edit so this works for now