From ab266e9da906a1d6e3d77c1921a4bb4fa40589eb Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Mon, 9 Feb 2026 22:21:23 +0000 Subject: [PATCH] fix: remove duplicate old code in weapon_selector _on_select - Remove duplicate code block that used 'ammo' instead of 'ammo_burn' - The old code was left behind after adding try/except wrapper --- ui/weapon_selector.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/ui/weapon_selector.py b/ui/weapon_selector.py index 944d96b..b943ef3 100644 --- a/ui/weapon_selector.py +++ b/ui/weapon_selector.py @@ -261,20 +261,6 @@ class WeaponSelectorDialog(QDialog): self.preview_name.setText(str(weapon.name) if weapon.name else "Unknown") self.preview_cost.setText("Error") self.ok_btn.setEnabled(False) - - # Calculate cost per shot - decay_pec = Decimal(str(weapon.decay)) - ammo = Decimal(str(weapon.ammo)) - cost_per_shot = (decay_pec / Decimal("100")) + (ammo * Decimal("0.0001")) - - # Update preview - self.preview_name.setText(weapon.name) - self.preview_damage.setText(str(weapon.damage)) - self.preview_decay.setText(f"{weapon.decay} PEC") - self.preview_ammo.setText(str(weapon.ammo)) - self.preview_cost.setText(f"{cost_per_shot:.4f} PED") - - self.ok_btn.setEnabled(True) def _on_double_click(self, item): """Double-click to select immediately."""