diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a49825422..394054be6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel ### Added - Added a new font in default_skin.lua to fit the localization (by @Satton2) +- Fixed knife death effect being permanently applied on every following death ### Changed diff --git a/gamemodes/terrortown/gamemode/server/sv_corpse.lua b/gamemodes/terrortown/gamemode/server/sv_corpse.lua index ae64374b2a..e82f49d305 100644 --- a/gamemodes/terrortown/gamemode/server/sv_corpse.lua +++ b/gamemodes/terrortown/gamemode/server/sv_corpse.lua @@ -539,6 +539,9 @@ realdamageinfo = 0 function CORPSE.Create(ply, attacker, dmginfo) if not IsValid(ply) then return end + local efn = ply.effect_fn + ply.effect_fn = nil + local rag = ents.Create("prop_ragdoll") if not IsValid(rag) then return end @@ -618,10 +621,8 @@ function CORPSE.Create(ply, attacker, dmginfo) end -- create advanced death effects (knives) - if ply.effect_fn then + if efn then -- next frame, after physics is happy for this ragdoll - local efn = ply.effect_fn - timer.Simple(0, function() if not IsValid(rag) then return end