From 9c7c9b5339a5a6c9bd3cb844924037b6a11d77d5 Mon Sep 17 00:00:00 2001 From: JetBoom Date: Tue, 11 Nov 2014 20:25:52 -0500 Subject: [PATCH] Fixed nail health lower if nailed while holding. --- .../zombiesurvival/gamemode/obj_entity_extend_sv.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua b/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua index ed5937f..c60bae5 100644 --- a/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua +++ b/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua @@ -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)