From c066f3d9fc96cebc4fbbea70e00ca82f7ecb6c6b Mon Sep 17 00:00:00 2001 From: thecraftianman <64441307+thecraftianman@users.noreply.github.com> Date: Fri, 10 May 2024 14:33:23 -0400 Subject: [PATCH] Tiny bit more turret optimization --- lua/entities/acf_turret/init.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lua/entities/acf_turret/init.lua b/lua/entities/acf_turret/init.lua index 754ea7744..97100b652 100644 --- a/lua/entities/acf_turret/init.lua +++ b/lua/entities/acf_turret/init.lua @@ -789,27 +789,28 @@ do -- Metamethods end function ENT:InputDirection(Direction) - if self.Disabled then return end + local SelfTbl = self:GetTable() + if SelfTbl.Disabled then return end - self.Manual = true - self.UseVector = false + SelfTbl.Manual = true + SelfTbl.UseVector = false if isnumber(Direction) then - self.DesiredDeg = math.NormalizeAngle(Direction) + SelfTbl.DesiredDeg = math.NormalizeAngle(Direction) return end - self.Manual = false + SelfTbl.Manual = false if isangle(Direction) then Direction:Normalize() - self.DesiredAngle = Direction + SelfTbl.DesiredAngle = Direction return end if isvector(Direction) then - self.UseVector = true - self.DesiredVector = Direction + SelfTbl.UseVector = true + SelfTbl.DesiredVector = Direction return end