Skip to content

Commit

Permalink
Slight fuel armor value tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
thecraftianman committed Oct 7, 2023
1 parent e76fb44 commit fc66144
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/entities/acf_fueltank/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ local RefillDist = ACF.RefillDistance * ACF.RefillDistance
local TimerCreate = timer.Create
local TimerExists = timer.Exists
local HookRun = hook.Run
local Wall = ACF.FuelArmor * ACF.MmToInch -- Wall thickness in inches

local function CanRefuel(Refill, Tank, Distance)
if Refill == Tank then return false end
Expand Down Expand Up @@ -50,6 +49,7 @@ do -- Spawn and Update functions
}

local function VerifyData(Data)
-- Updating pre-scalable update fuel tanks
if string.StartsWith(Data.FuelTank, "Tank_") then
-- Deriving box dimensions from the FuelTank string because there is no size
local SizeString = string.Split(Data.FuelTank, "_")
Expand Down Expand Up @@ -135,6 +135,7 @@ do -- Spawn and Update functions

local Size = Data.Size
local Volume, Area, NameType
local Wall = ACF.FuelArmor * ACF.MmToInch -- Wall thickness in inches

if FuelTank.ID == "Box" then
local InteriorVolume = (Size.x - Wall) * (Size.y - Wall) * (Size.z - Wall) -- Math degree
Expand Down Expand Up @@ -596,6 +597,8 @@ end
function ENT:OnResized(Size)
do -- Calculate new empty mass
local Volume
local Wall = ACF.FuelArmor * ACF.MmToInch -- Wall thickness in inches

if self.FuelTank == "Drum" then
local Radius = Size.x / 2
local ExteriorVolume = math.pi * (Radius ^ 2) * Size.z
Expand Down

0 comments on commit fc66144

Please sign in to comment.