From 2c00b72d730d7bb2867156114f6f420ed71632be Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+AnArgonianLizardThatStealsPRs@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:42:41 +0300 Subject: [PATCH] [MIRROR] Removes duplicate atom break calls on atoms taking damage [MDB IGNORE] (#604) * Removes duplicate atom break calls on atoms taking damage (#79667) --------- Co-authored-by: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Co-authored-by: distributivgesetz --- code/game/atom_defense.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/atom_defense.dm b/code/game/atom_defense.dm index 889aaba1101..d96ac9382d5 100644 --- a/code/game/atom_defense.dm +++ b/code/game/atom_defense.dm @@ -19,14 +19,18 @@ . = damage_amount + var/previous_atom_integrity = atom_integrity + update_integrity(atom_integrity - damage_amount) + var/integrity_failure_amount = integrity_failure * max_integrity + //BREAKING FIRST - if(integrity_failure && atom_integrity <= integrity_failure * max_integrity) + if(integrity_failure && previous_atom_integrity > integrity_failure_amount && atom_integrity <= integrity_failure_amount) atom_break(damage_flag) //DESTROYING SECOND - if(atom_integrity <= 0) + if(atom_integrity <= 0 && previous_atom_integrity > 0) atom_destruction(damage_flag) /// Proc for recovering atom_integrity. Returns the amount repaired by