From 7f4cd0140ec4f88da3be0f0e39d424c2b842cd69 Mon Sep 17 00:00:00 2001 From: Mr Marty <57878680+MartyX5555@users.noreply.github.com> Date: Sat, 21 Oct 2023 18:45:45 -0300 Subject: [PATCH] added parameters for invalid owners for tracking devices. Giving same order to the irst too. --- lua/entities/ace_irst/init.lua | 6 +++++- lua/entities/ace_trackingradar/init.lua | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lua/entities/ace_irst/init.lua b/lua/entities/ace_irst/init.lua index b2291e6c..90be115a 100644 --- a/lua/entities/ace_irst/init.lua +++ b/lua/entities/ace_irst/init.lua @@ -299,7 +299,11 @@ function ENT:AcquireLock() local angerr = Angle(finalerror, finalerror, finalerror) * randanginac --For Owner table - table.insert(Owners, IsValid(scanEnt:CPPIGetOwner()) and scanEnt:CPPIGetOwner():GetName() or "") + local Owner = scanEnt:CPPIGetOwner() + local NickName = IsValid(Owner) and Owner:GetName() or "" + + + table.insert(Owners, NickName) table.insert(Temperatures, Heat) table.insert(AngTable, -ang + angerr) -- Negative means that if the target is higher than irst = positive pitch diff --git a/lua/entities/ace_trackingradar/init.lua b/lua/entities/ace_trackingradar/init.lua index dc70893b..da8193db 100644 --- a/lua/entities/ace_trackingradar/init.lua +++ b/lua/entities/ace_trackingradar/init.lua @@ -305,9 +305,12 @@ function ENT:Think() self.ClosestToBeam = #ownArray + 1 besterr = err end - --print((entpos - thisPos):Length()) - table.insert(ownArray , scanEnt:CPPIGetOwner():GetName() or "") + --For Owner table + local Owner = scanEnt:CPPIGetOwner() + local NickName = IsValid(Owner) and Owner:GetName() or "" + + table.insert(ownArray , NickName) table.insert(posArray ,entpos + randinac * errorFromAng * 2000 + randinac * ((entpos - thisPos):Length() * (self.InaccuracyMul * 0.8 + GCdis * 0.1 ))) --3 --IDK if this is more intensive than length