Skip to content

Commit

Permalink
Prevent pain sound from playing when dead.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrist committed Aug 19, 2018
1 parent 1f0ab0a commit 1f43c94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gamemode/core/hooks/sv_hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ function GM:GetPlayerPainSound(client)
end

function GM:PlayerHurt(client, attacker, health, damage)
if ((client.ixNextPain or 0) < CurTime()) then
if ((client.ixNextPain or 0) < CurTime() and health > 0) then
local painSound = hook.Run("GetPlayerPainSound", client) or painSounds[math.random(1, #painSounds)]

if (client:IsFemale() and !painSound:find("female")) then
Expand Down

0 comments on commit 1f43c94

Please sign in to comment.