From af15e7e3d17bcdee697aa18729cdbbf626f00365 Mon Sep 17 00:00:00 2001 From: Deyan Dobromirov Date: Sun, 10 Dec 2017 23:14:51 +0200 Subject: [PATCH] Fixed: Tool screen draws existent anchor when the entity is removed --- lua/autorun/trackassembly_init.lua | 2 +- lua/weapons/gmod_tool/stools/trackassembly.lua | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index 28ad5679..2807b2ab 100644 --- a/lua/autorun/trackassembly_init.lua +++ b/lua/autorun/trackassembly_init.lua @@ -33,7 +33,7 @@ local asmlib = trackasmlib ------ CONFIGURE ASMLIB ------ asmlib.InitBase("track","assembly") -asmlib.SetOpVar("TOOL_VERSION","5.425") +asmlib.SetOpVar("TOOL_VERSION","5.426") asmlib.SetIndexes("V",1,2,3) asmlib.SetIndexes("A",1,2,3) asmlib.SetIndexes("S",4,5,6,7) diff --git a/lua/weapons/gmod_tool/stools/trackassembly.lua b/lua/weapons/gmod_tool/stools/trackassembly.lua index 36d66d12..47fd0124 100644 --- a/lua/weapons/gmod_tool/stools/trackassembly.lua +++ b/lua/weapons/gmod_tool/stools/trackassembly.lua @@ -366,15 +366,15 @@ function TOOL:IntersectSnap(trEnt, vHit, stSpawn, bMute) end function TOOL:ClearAnchor(bMute) - local svEnt = self:GetEnt(1) - local plPly = self:GetOwner() + local svEnt, plPly = self:GetEnt(1), self:GetOwner() + if(CLIENT) then return end; self:ClearObjects() + asmlib.ConCommandPly(plPly,"anchor",gsNoAnchor) if(svEnt and svEnt:IsValid()) then - svEnt:SetRenderMode(RENDERMODE_TRANSALPHA) svEnt:SetColor(conPalette:Select("w")) - if(not bMute and SERVER) then + svEnt:SetRenderMode(RENDERMODE_TRANSALPHA) + if(not bMute) then local sAnchor = svEnt:EntIndex()..gsSymRev..svEnt:GetModel():GetFileFromFilename() asmlib.PrintNotifyPly(plPly,"Anchor: Cleaned "..sAnchor.." !","CLEANUP") end - self:ClearObjects(); asmlib.ConCommandPly(plPly,"anchor",gsNoAnchor) end; return asmlib.StatusLog(true,"TOOL:ClearAnchor("..tostring(bMute).."): Anchor cleared") end