Skip to content

Commit

Permalink
Corpse: fix effect_fn being permanent (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
wgetJane authored Apr 23, 2023
1 parent 65c0055 commit 2c20a48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions gamemodes/terrortown/gamemode/server/sv_corpse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 2c20a48

Please sign in to comment.