Skip to content

Commit

Permalink
Micro-log optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvideo1234 committed Sep 13, 2017
1 parent e9ffad2 commit 61662fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 4 additions & 2 deletions lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ local asmlib = trackasmlib

------ CONFIGURE ASMLIB ------
asmlib.InitBase("track","assembly")
asmlib.SetOpVar("TOOL_VERSION","5.371")
asmlib.SetOpVar("TOOL_VERSION","5.372")
asmlib.SetIndexes("V",1,2,3)
asmlib.SetIndexes("A",1,2,3)
asmlib.SetIndexes("S",4,5,6,7)
Expand Down Expand Up @@ -61,7 +61,9 @@ asmlib.SetOpVar("LOG_SKIP",{
"MakeScreen: Color list not container",
"BIND_PRESS: Swep not tool",
"BIND_PRESS: Tool different",
"BIND_PRESS: Active key missing"
"BIND_PRESS: Active key missing",
"IntersectRayRead",
"IntersectRayClear"
})

------ VARIABLE FLAGS ------
Expand Down
12 changes: 5 additions & 7 deletions lua/weapons/gmod_tool/stools/trackassembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,7 @@ function TOOL:IntersectSnap(trEnt, vHit, stSpawn, bLoop)
local lx = mathAbs(dx:Dot(aOrg:Forward()))
local ly = mathAbs(dy:Dot(aOrg:Right()))
local lz = mathAbs(dz:Dot(aOrg:Up()))
vx = mathClamp(vx, -lx, lx)
vy = mathClamp(vy, -ly, ly)
vz = mathClamp(vz, -lz, lz)
vx, vy, vz = mathClamp(vx, -lx, lx), mathClamp(vy, -ly, ly), mathClamp(vz, -lz, lz)
end; cx:Mul(vx); cy:Mul(vy); cz:Mul(vz)
stSpawn.SPos:Add(cx); stSpawn.SPos:Add(cy); stSpawn.SPos:Add(cz); return true
end
Expand Down Expand Up @@ -728,7 +726,7 @@ function TOOL:Reload(stTrace)
asmlib.ConCommandPly(ply, "exportdb", 0)
end
if(asmlib.CheckButtonPly(ply,IN_SPEED)) then
if(workmode == 1) then self:ClearAnchor()
if(workmode == 1) then self:ClearAnchor()
asmlib.LogInstance("TOOL:Reload(Anchor): Clear")
elseif(workmode == 2) then self:IntersectClear()
asmlib.LogInstance("TOOL:Reload(Relate): Clear")
Expand All @@ -737,7 +735,7 @@ function TOOL:Reload(stTrace)
elseif(trEnt and trEnt:IsValid()) then
if(not asmlib.IsPhysTrace(stTrace)) then return false end
if(asmlib.IsOther(trEnt)) then
return asmlib.StatusLog(false,"TOOL:Reload(Prop): Trace other object") end
return asmlib.StatusLog(false,"TOOL:Reload(Prop): Trace other object") end
if(asmlib.CheckButtonPly(ply,IN_SPEED)) then
if(workmode == 1) then -- General anchor
if(not self:SetAnchor(stTrace)) then
Expand All @@ -747,7 +745,7 @@ function TOOL:Reload(stTrace)
if(not self:IntersectRelate(ply, trEnt, stTrace.HitPos)) then
return asmlib.StatusLog(false,self:GetStatus(stTrace,"TOOL:Reload(Prop): Relation set fail")) end
return asmlib.StatusLog(true,"TOOL:Reload(Prop): Relation set")
end
end
end
local trRec = asmlib.CacheQueryPiece(trEnt:GetModel())
if(asmlib.IsExistent(trRec)) then trEnt:Remove()
Expand Down Expand Up @@ -1048,7 +1046,7 @@ function TOOL:DrawHUD()
hudMonitor:DrawCircle(Ss, rdScale,"c")
hudMonitor:DrawCircle(xX, 3 * rdScale, "ry")
hudMonitor:DrawLine(xX,O1)
hudMonitor:DrawLine(xX,O2)
hudMonitor:DrawLine(xX,O2)
hudMonitor:DrawCircle(O2, rdScale / 2, "g")
end
end
Expand Down

0 comments on commit 61662fa

Please sign in to comment.