diff --git a/lua/entities/acf_gun/init.lua b/lua/entities/acf_gun/init.lua index 9dbaa243..ebae4837 100644 --- a/lua/entities/acf_gun/init.lua +++ b/lua/entities/acf_gun/init.lua @@ -32,7 +32,6 @@ local function UpdateTotalAmmo(Entity) end do -- Spawn and Update functions -------------------------------- - local ModelData = ACF.ModelData local WireIO = Utilities.WireIO local Entities = Classes.Entities local Weapons = Classes.Weapons @@ -114,14 +113,13 @@ do -- Spawn and Update functions -------------------------------- return Result end - local function GetMass(Model, PhysObj, Class, Weapon) - if Weapon then return Weapon.Mass end + local function GetMass(Caliber, Class, Weapon) + if Weapon then return Weapon.Mass end - local Volume = PhysObj:GetVolume() - local Factor = Volume / ModelData.GetModelVolume(Model) + local Factor = Caliber / Class.Caliber.Base - return math.Round(Class.Mass * Factor) - end + return math.Round(Class.Mass * Factor ^ 3) -- 3d space so scaling has a cubing effect + end local function UpdateWeapon(Entity, Data, Class, Weapon) local Model = Weapon and Weapon.Model or Class.Model @@ -190,7 +188,7 @@ do -- Spawn and Update functions -------------------------------- local PhysObj = Entity.ACF.PhysObj if IsValid(PhysObj) then - local Mass = GetMass(Model, PhysObj, Class, Weapon) + local Mass = GetMass(Caliber, Class, Weapon) Contraption.SetMass(Entity, Mass) end