Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions content/scripts/library_ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down