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,9 +3,13 @@ if not meta then return end
|
||||||
|
|
||||||
function meta:GetDefaultBarricadeHealth()
|
function meta:GetDefaultBarricadeHealth()
|
||||||
local mass = 2
|
local mass = 2
|
||||||
local phys = self:GetPhysicsObject()
|
if self._OriginalMass then
|
||||||
if phys:IsValid() then
|
mass = self._OriginalMass
|
||||||
mass = phys:GetMass()
|
else
|
||||||
|
local phys = self:GetPhysicsObject()
|
||||||
|
if phys:IsValid() then
|
||||||
|
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)
|
||||||
|
|
Loading…
Reference in a new issue