From 16c9e5dab24ca9d989c6c2bc94ad3f77ffc60100 Mon Sep 17 00:00:00 2001 From: AlmTech Software Date: Sat, 8 Feb 2020 22:27:32 +0100 Subject: [PATCH] Bug fixes post closed-beta --- gamemode/engine/core/server/sv_player_damage.lua | 4 +++- gamemode/settings/sh_effects.lua | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gamemode/engine/core/server/sv_player_damage.lua b/gamemode/engine/core/server/sv_player_damage.lua index 25bf8dc..8c073a8 100644 --- a/gamemode/engine/core/server/sv_player_damage.lua +++ b/gamemode/engine/core/server/sv_player_damage.lua @@ -63,7 +63,9 @@ hook.Add( "EntityTakeDamage", "Quantum_PlayerDamage_SoundEffect", function( pl, end) timer.Simple( 60, function() - timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl:SteamID64() ) ) -- remove the timer for the player + if( IsValid( pl ) ) then + timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl:SteamID64() ) ) -- remove the timer for the player + end end) end diff --git a/gamemode/settings/sh_effects.lua b/gamemode/settings/sh_effects.lua index 34705c0..1046f71 100644 --- a/gamemode/settings/sh_effects.lua +++ b/gamemode/settings/sh_effects.lua @@ -29,12 +29,14 @@ Quantum.Effect.Create( "equip_potatoe", { pl.runtimeEffect_timerActive_equip_potatoe = false end, runtimefunc = function( pl ) - if( !pl.runtimeEffect_timerActive_equip_potatoe ) then - pl.runtimeEffect_timerActive_equip_potatoe = true - timer.Simple( 1, function() - pl:SetHealth( math.Clamp( pl:Health() + 5, 1, pl:GetMaxHealth() ) ) - pl.runtimeEffect_timerActive_equip_potatoe = false - end) + if( IsValid( pl ) ) then + if( !pl.runtimeEffect_timerActive_equip_potatoe ) then + pl.runtimeEffect_timerActive_equip_potatoe = true + timer.Simple( 1, function() + pl:SetHealth( math.Clamp( pl:Health() + 5, 1, pl:GetMaxHealth() ) ) + pl.runtimeEffect_timerActive_equip_potatoe = false + end) + end end end, stopfunc = function( pl )