add (hack-y) check if player actually left

This commit is contained in:
techbot 2023-05-17 01:05:33 +02:00
parent c8283f046c
commit 0ca0956d18

View File

@ -329,14 +329,14 @@ function emut.RemoveMutationsForPlayer(ply)
end
hook.Add("EntityRemoved", "pac_entity_mutators_left", function(ent)
timer.Simple(0, function()
if not IsValid(ent) then return end
if ent:IsPlayer() then
emut.RemoveMutationsForPlayer(ent)
if Player(ent:UserID()) == NULL then
emut.RemoveMutationsForPlayer(ent)
end
else
emut.RemoveMutatorsOwnedByEntity(ent)
end
end)
end)
if CLIENT then