From 467cf9ab2506dbd94cc91398df75be96c2acbf51 Mon Sep 17 00:00:00 2001 From: Xerasin Date: Sun, 15 May 2022 20:46:58 -0700 Subject: [PATCH] More cleanup --- lua/autorun/wowozela.lua | 11 ++++------- lua/weapons/wowozela.lua | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lua/autorun/wowozela.lua b/lua/autorun/wowozela.lua index 091281c..9f9d266 100644 --- a/lua/autorun/wowozela.lua +++ b/lua/autorun/wowozela.lua @@ -26,7 +26,7 @@ end if CLIENT then - wowozela.Samplers = wowozela.Samplers or {} + wowozela.Samplers = {} wowozela.volume = CreateClientConVar("wowozela_volume", "0.5", true, false) wowozela.hudtext = CreateClientConVar("wowozela_hudtext", "1", true, false) wowozela.pitchbar = CreateClientConVar("wowozela_pitchbar", "1", true, false) @@ -314,8 +314,6 @@ if CLIENT then -- sample meta META.__index = META function META:Initialize(ply) - ply.wowozela_sampler = self - self.Player = NULL self.Pitch = 100 @@ -723,14 +721,13 @@ if CLIENT then -- sample meta local sampler = setmetatable({}, wowozela.SamplerMeta) sampler:Initialize(ply) - ply.wowozela_sampler = sampler - wowozela.Samplers[ply:AccountID() or ply:UserID()] = sampler + wowozela.Samplers[ply:UserID()] = sampler return sampler end function wowozela.GetSampler(ply) - return ply.wowozela_sampler + return wowozela.Samplers[ply:UserID()] end end @@ -798,7 +795,7 @@ do -- hooks wowozela.disabled = vol < 0.01 for _, ply in ipairs(player.GetHumans()) do - if not ply.wowozela_sampler then + if not wowozela.Samplers[ply:UserID()] then wowozela.CreateSampler(ply) end end diff --git a/lua/weapons/wowozela.lua b/lua/weapons/wowozela.lua index 3a99578..a832e1f 100644 --- a/lua/weapons/wowozela.lua +++ b/lua/weapons/wowozela.lua @@ -988,7 +988,7 @@ if CLIENT then surface.SetDrawColor(Color(0, 255, 55, 120)) surface.DrawLine(ScrW() - 18, center_y, ScrW(), center_y) draw.TextShadow({ - text = ("%0.01f"):format(curr_pitch), + text = ("%0.1f"):format(curr_pitch), color = Color(255, 255, 255, 255), pos = {ScrW() - 19, center_y}, xalign = TEXT_ALIGN_RIGHT,