Fixed nail health lower if nailed while holding.

This commit is contained in:
JetBoom 2014-11-11 20:25:52 -05:00
parent 4ece4c30ea
commit 9c7c9b5339

View file

@ -3,9 +3,13 @@ if not meta then return end
function meta:GetDefaultBarricadeHealth()
local mass = 2
local phys = self:GetPhysicsObject()
if phys:IsValid() then
mass = phys:GetMass()
if self._OriginalMass then
mass = self._OriginalMass
else
local phys = self:GetPhysicsObject()
if phys:IsValid() then
mass = phys:GetMass()
end
end
return math.Clamp(mass * GAMEMODE.BarricadeHealthMassFactor + self:GetVolume() * GAMEMODE.BarricadeHealthVolumeFactor, GAMEMODE.BarricadeHealthMin, GAMEMODE.BarricadeHealthMax)