From 09e07984a0d932bb0fe0c0412c8034423a6ef625 Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Mon, 9 Feb 2026 15:12:39 +0000 Subject: [PATCH] fix(calc): correct PEC to PED conversion for cost/shot display Cost per shot was showing PEC values labeled as PED (100x too high). Now properly converts PEC to PED by dividing by 100 before display. Before: 916.80 PEC displayed as 9.1680 PED (wrong) After: 916.80 PEC displayed as 0.0917 PED (correct) --- ui/loadout_manager.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/loadout_manager.py b/ui/loadout_manager.py index 845d8d1..83f1ef4 100644 --- a/ui/loadout_manager.py +++ b/ui/loadout_manager.py @@ -1890,8 +1890,9 @@ class LoadoutManagerDialog(QDialog): config = self._get_current_config() # Weapon metrics (per shot, not per hour) - cost_per_shot = config.get_total_decay_per_shot() + config.get_total_ammo_per_shot() - self.cost_per_shot_label.setText(f"{cost_per_shot:.4f} PED") + cost_per_shot_pec = config.get_total_decay_per_shot() + config.get_total_ammo_per_shot() + cost_per_shot_ped = cost_per_shot_pec / Decimal("100") # Convert PEC to PED + self.cost_per_shot_label.setText(f"{cost_per_shot_ped:.4f} PED") # DPS calculation dps = config.calculate_dps() @@ -1902,7 +1903,7 @@ class LoadoutManagerDialog(QDialog): self.dpp_label.setText(f"{dpp:.4f}") # Armor metrics (cost per hit) - cost_per_hit = config.get_armor_decay_per_hit() + cost_per_hit = config.get_armor_decay_per_hit() # Already returns PED self.cost_per_hit_label.setText(f"{cost_per_hit:.4f} PED") # Protection summary @@ -1914,7 +1915,7 @@ class LoadoutManagerDialog(QDialog): self.protection_summary_label.setText(f"Total: {protection.get_total():.1f} | {prot_text}") # Healing metrics - cost_per_heal = config.get_heal_cost_per_use() + cost_per_heal = config.get_heal_cost_per_use() # Already returns PED self.cost_per_heal_label.setText(f"{cost_per_heal:.4f} PED") hp_per_pec = config.get_hp_per_pec()