Skip to content
Merged
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
5 changes: 3 additions & 2 deletions lua/cfw/extensions/mass_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
local PHYS = FindMetaTable("PhysObj")
local setMass = setMass or PHYS.SetMass

function PHYS:SetMass(newMass)
local ent = self:GetEntity()
-- Callers that already have the entity can pass it
function PHYS:SetMass(newMass, ent)
ent = ent or self:GetEntity()
local oldMass = ent._mass or 0 -- The 'or 0' handles cases of ents connected before they had a physObj
local massDelta = newMass - oldMass

Expand Down