Fixed nail health lower if nailed while holding.
This commit is contained in:
parent
4ece4c30ea
commit
9c7c9b5339
1 changed files with 7 additions and 3 deletions
|
@ -3,10 +3,14 @@ if not meta then return end
|
||||||
|
|
||||||
function meta:GetDefaultBarricadeHealth()
|
function meta:GetDefaultBarricadeHealth()
|
||||||
local mass = 2
|
local mass = 2
|
||||||
|
if self._OriginalMass then
|
||||||
|
mass = self._OriginalMass
|
||||||
|
else
|
||||||
local phys = self:GetPhysicsObject()
|
local phys = self:GetPhysicsObject()
|
||||||
if phys:IsValid() then
|
if phys:IsValid() then
|
||||||
mass = phys:GetMass()
|
mass = phys:GetMass()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return math.Clamp(mass * GAMEMODE.BarricadeHealthMassFactor + self:GetVolume() * GAMEMODE.BarricadeHealthVolumeFactor, GAMEMODE.BarricadeHealthMin, GAMEMODE.BarricadeHealthMax)
|
return math.Clamp(mass * GAMEMODE.BarricadeHealthMassFactor + self:GetVolume() * GAMEMODE.BarricadeHealthVolumeFactor, GAMEMODE.BarricadeHealthMin, GAMEMODE.BarricadeHealthMax)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue