Skip to content

Commit

Permalink
ClassesInfo updating is now handled inside a hook (not inside a cvar_…
Browse files Browse the repository at this point in the history
…callback anymore...)
  • Loading branch information
lebroomer committed Jun 29, 2019
1 parent 92acfb0 commit cb32be9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lua/classes/client/cl_hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ local margin = 10

local classInformationAdded = false

cvars.AddChangeCallback( "cttt2_current_hud", function( convar_name, value_old, value_new )
classInformationAdded = false
ClassesInfo(LocalPlayer())
end )

local function ClassesInfo(client)
local round_state = GAMEMODE.round_state

Expand Down Expand Up @@ -479,3 +474,8 @@ hook.Add("VGUIMousePressed", "VGUIMousePressedTTTC", function(pnl, Mouse)
gui.EnableScreenClicker(false)
end
end)

hook.Add("TTT2HUDUpdated", "TTTCUpdateClassesInfo", function()
classInformationAdded = false
ClassesInfo(LocalPlayer())
end)

0 comments on commit cb32be9

Please sign in to comment.