From ed48832137ae6c79230e96c76dae7db3c44adf80 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 5 May 2024 19:33:11 +0200 Subject: [PATCH] fix: ECM drones do not have DPS (#37) --- src/calculate/pass_4/drone.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calculate/pass_4/drone.rs b/src/calculate/pass_4/drone.rs index 15e0651..9e82f2d 100644 --- a/src/calculate/pass_4/drone.rs +++ b/src/calculate/pass_4/drone.rs @@ -73,7 +73,10 @@ pub fn attribute_drone_damage(ship: &mut Ship) { let attr_damage_without_reload_dps = AttributeId::damageWithoutReloadDps as i32; for item in &mut ship.items { - if item.flag == 87 && item.state == EffectCategory::Active { + if item.flag == 87 + && item.state == EffectCategory::Active + && item.attributes.contains_key(&attr_damage_alpha_hp) + { let damage_alpha_hp = item.attributes.get(&attr_damage_alpha_hp).unwrap(); total_base_alpha_hp += damage_alpha_hp.base_value; total_alpha_hp += damage_alpha_hp.value.unwrap();