Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Various changes
Browse files Browse the repository at this point in the history
- Removed useless timer for giving weapons
- Removed SetBloodColor as it doesn't do anything in this case
- Removed useless "return" in hooks
- Removed GetActiveWeapon() as it's useless and produces errors
  • Loading branch information
MinIsMin committed May 24, 2017
1 parent eb22872 commit 6079d27
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
28 changes: 13 additions & 15 deletions lua/sv_specdm_overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ hook.Add("PlayerSpawn", "PlayerSpawn_SpecDM", function(ply)
if ply:IsGhost() then
ply.has_spawned = true
ply:UnSpectate()
timer.Simple(0.1, function() if IsValid(ply) and ply:IsGhost() and ply:GetWeapons() == nil then ply:GiveGhostWeapons() end end)
if IsValid(ply) and ply:IsGhost() and ply:GetWeapons() == nil then
ply:GiveGhostWeapons()
end
hook.Call("PlayerSetModel", GAMEMODE, ply)
return
else
ply:SetBloodColor(0)
end
end)

Expand All @@ -75,19 +74,18 @@ hook.Add("PlayerDeath", "PlayerDeath_SpecDM", function(victim, inflictor, attack
timer.Simple(0, function()
SpecDM_Respawn(victim)
end)
return
end
net.Start("SpecDM_RespawnTimer")
net.Send(victim)
timer.Simple(SpecDM.RespawnTime, function()
victim.allowrespawn = true
end)
if SpecDM.AutomaticRespawnTime > -1 then
timer.Simple(SpecDM.AutomaticRespawnTime + SpecDM.RespawnTime, function()
SpecDM_Respawn(victim)
else
net.Start("SpecDM_RespawnTimer")
net.Send(victim)
timer.Simple(SpecDM.RespawnTime, function()
victim.allowrespawn = true
end)
if SpecDM.AutomaticRespawnTime > -1 then
timer.Simple(SpecDM.AutomaticRespawnTime + SpecDM.RespawnTime, function()
SpecDM_Respawn(victim)
end)
end
end
return
elseif GetRoundState() == ROUND_ACTIVE and victim:IsActive() then
timer.Simple(2, function()
if IsValid(victim) then
Expand Down
1 change: 0 additions & 1 deletion lua/sv_spectator_deathmatch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ function meta:ManageGhost(spawn, silent)
self:SetGhost(spawn)
if spawn then
self:Spawn()
self:SetBloodColor(-1)
self:GiveGhostWeapons()
SpecDM:RelationShip(self)
else
Expand Down
1 change: 0 additions & 1 deletion lua/sv_stats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ hook.Add("PlayerDeath", "PlayerDeath_SpecDMStats", function(ply, killer, inflict
end
ply:SpecDM_CheckKillRows()
end
local weapon = killer:GetActiveWeapon()
local dmg = {
GetInflictor = function()
return inflictor
Expand Down

0 comments on commit 6079d27

Please sign in to comment.