From 77fea51273ae8d6938d22eba6329a665ee707dce Mon Sep 17 00:00:00 2001 From: JetBoom Date: Sat, 10 Jan 2015 00:15:00 -0500 Subject: [PATCH] Fix multiple nails stopping constraints being removed on dead prop. Addresses https://github.com/JetBoom/zombiesurvival/issues/100 --- gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua b/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua index 89a5113..02077cd 100644 --- a/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua +++ b/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua @@ -391,7 +391,7 @@ function meta:RemoveNail(nail, dontremoveentity, removedby) local cons = nail:GetNailConstraint() local othernails = 0 for _, othernail in pairs(ents.FindByClass("prop_nail")) do - if othernail ~= nail and othernail:GetNailConstraint():IsValid() and othernail:GetNailConstraint() == cons then + if othernail ~= nail and not nail.m_IsRemoving and othernail:GetNailConstraint():IsValid() and othernail:GetNailConstraint() == cons then othernails = othernails + 1 end end