From 3e89d66f1202db20bca62599032abea44d5e300d Mon Sep 17 00:00:00 2001 From: NexusQuile <104992166+NexusQuile@users.noreply.github.com> Date: Tue, 2 Dec 2025 17:37:13 +0000 Subject: [PATCH] Fuel Pod UI bug-fix As fuel pod has ammo count of 1, the UI would show always show 50%+fuel remaining. Bug fix to correctly calculate remaining fuel. --- content/scripts/library_ui.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/content/scripts/library_ui.lua b/content/scripts/library_ui.lua index 13e3678..8c365f4 100644 --- a/content/scripts/library_ui.lua +++ b/content/scripts/library_ui.lua @@ -3070,10 +3070,12 @@ function imgui_vehicle_chassis_loadout(ui, vehicle, selected_bay_index) end if attachment:get_fuel_capacity() > 0 then - total_capacity = total_capacity + 1 - resupply_factor = resupply_factor + attachment:get_fuel_factor() - end - + --fuel tanks have an ammo capacity of 1 so do not increment the total capacity by 1 otherwise the renormalisation goes wrong below. + --total_capacity = total_capacity + 1 + --resupply_factor = resupply_factor + attachment:get_fuel_factor() + resupply_factor = attachment:get_fuel_remaining() / attachment:get_fuel_capacity() + end + --renormalisation of capacity to account for fuel tanks having ammo count, not strickly needed now but kept to match basse game code. resupply_factor = iff(total_capacity == 0, 1, resupply_factor / total_capacity) local attachment_icon_region, attachment_16_icon_region = get_attachment_icons(attachment_definition_index)