Skip to content

Commit

Permalink
Merge pull request #2015 from marchkarcz/master
Browse files Browse the repository at this point in the history
Fix nil error
  • Loading branch information
bigdogmat authored Jan 10, 2020
2 parents 40d22d8 + 6463802 commit c93eb51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_expression2/core/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,19 @@ end
e2function number entity:volume()
if not validPhysics(this) then return 0 end
local phys = this:GetPhysicsObject()
return phys:GetVolume()
return phys:GetVolume() or 0
end

e2function number entity:surfaceArea()
if not validPhysics(this) then return 0 end
local phys = this:GetPhysicsObject()
return phys:GetSurfaceArea()
return phys:GetSurfaceArea() or 0
end

e2function number entity:stress()
if not validPhysics(this) then return 0 end
local phys = this:GetPhysicsObject()
return phys:GetStress()
return phys:GetStress() or 0
end

/******************************************************************************/
Expand Down

0 comments on commit c93eb51

Please sign in to comment.