Skip to content

Commit

Permalink
Validity Checks
Browse files Browse the repository at this point in the history
ttt? :(
  • Loading branch information
rejax committed Dec 28, 2014
1 parent 4c456a0 commit 234cc80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/autorun/client/TTT_EasyScoreboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ function EZS.AddRankLabel( sb )
local function AttachDynamicColor( label, ply )
label.HasRainbow = true
label.Think = function( s )
if not IsValid( ply ) then return end
local rank = EZS.GetRank( ply )
if not rank then s:SetTextColor( color_white ) return end

Expand All @@ -212,6 +213,7 @@ function EZS.AddRankLabel( sb )
end
end
sb.nick.Think = function( s )
if not IsValid( ply ) then return end
local rank = EZS.GetRank( ply )
if not rank then s:SetTextColor( color_white ) return end

Expand Down Expand Up @@ -269,6 +271,7 @@ function EZS.AddRankLabel( sb )

if not rank.dynamic_col then
label.Think = function( s )
if not IsValid( ply ) then return end
local rank = EZS.GetRank( ply )
if not rank then return end

Expand Down Expand Up @@ -381,4 +384,4 @@ function EZS.AddMenu( menu )
end
hook.Add( "TTTScoreboardMenu", "EasyScoreboard_Menu", EZS.AddMenu )

concommand.Add( "ezs_refreshscoreboard", function() gamemode.Call( "ScoreboardCreate" ) end )
concommand.Add( "ezs_refreshscoreboard", function() gamemode.Call( "ScoreboardCreate" ) end )

0 comments on commit 234cc80

Please sign in to comment.