Skip to content

Commit

Permalink
Fixed: Minor run-time errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvideo1234 committed Sep 29, 2017
1 parent 5526191 commit 4935f04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions lua/autorun/gearassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local asmlib = gearasmlib

------ CONFIGURE ASMLIB ------
asmlib.InitBase("gear","assembly")
asmlib.SetOpVar("TOOL_VERSION","5.189")
asmlib.SetOpVar("TOOL_VERSION","5.190")
asmlib.SetIndexes("V",1,2,3)
asmlib.SetIndexes("A",1,2,3)
asmlib.SetIndexes("S",4,5,6,7)
Expand Down Expand Up @@ -117,8 +117,8 @@ if(SERVER) then
end)

asmlib.SetAction("PLAYER_QUIT",
function(oPly)
if(not asmlib.ClearCachePly(oPly)) then
function(oPly) -- Clear player cache when disconnects
if(not asmlib.CacheClearPly(oPly)) then
return asmlib.StatusLog(nil,"PLAYER_QUIT: Failed swiping stuff "..tostring(oPly)) end
return asmlib.StatusLog(nil,"PLAYER_QUIT: Success")
end)
Expand Down
12 changes: 6 additions & 6 deletions lua/gearassembly/gearasmlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1409,12 +1409,12 @@ local function CacheSpawnPly(pPly)
end; return plyData
end

function ClearCachePly(pPly)
function CacheClearPly(pPly)
if(not IsPlayer(pPly)) then
return StatusLog(false,"ClearCachePly: Player <"..tostring(pPly)"> invalid") end
return StatusLog(false,"CacheClearPly: Player <"..tostring(pPly)"> invalid") end
local plyPlace = libPlayer[pPly]
if(not IsExistent(plyPlace)) then
return StatusLog(true,"ClearCachePly: Clean") end
return StatusLog(true,"CacheClearPly: Clean") end
plyTable[pPly] = nil; collectgarbage(); return true
end

Expand All @@ -1432,7 +1432,7 @@ function CacheRadiusPly(pPly, vHit, nSca)
if(not IsExistent(plyData)) then
LogInstance("CacheRadiusPly: Malloc <"..pPly:Nick()..">")
plyPlace["RADIUS"] = {}; plyData = plyPlace["RADIUS"]
plyData["MAR"] = (GetOpVar("GOLDEN_RATIO") * 1000),
plyData["MAR"] = (GetOpVar("GOLDEN_RATIO") * 1000)
plyData["LIM"] = ((GetOpVar("GOLDEN_RATIO") - 1) * 100)
end
local nMul = (tonumber(nSca) or 1) -- Disable scaling on missing or outside
Expand All @@ -1447,7 +1447,7 @@ function CacheTracePly(pPly)
local plyPlace = GetPlacePly(pPly)
if(not IsExistent(plyPlace)) then
return StatusLog(nil,"CacheTracePly: Place missing") end
local plyData = plyPlace["TRACE"]
local plyData, plyTime = plyPlace["TRACE"], Time()
if(not IsExistent(plyData)) then -- Define trace delta margin
LogInstance("CacheTracePly: Malloc <"..pPly:Nick()..">")
plyPlace["TRACE"] = {}; plyData = plyPlace["TRACE"]
Expand Down Expand Up @@ -2863,7 +2863,7 @@ function GetEntitySpawn(oPly,trEnt,trPivot,hdPivot,hdModel,enIgnTyp,enOrAngTr,
-- Calculate the origin based on the center
stSpawn.OPos:Set(stSpawn.TPnt); stSpawn.OPos:Add(stSpawn.TMas)
stSpawn.OAng:Set(stSpawn.TAng); stSpawn.OAng:RotateAroundAxis(stSpawn.TAng:Right(),trRec.Rake)
return GetNormalSpawn(nil,nil,hdModel,hdPivot,enOrAngTr,ucsPosX,ucsPosY,ucsPosZ,ucsAngP,ucsAngY,ucsAngR)
return GetNormalSpawn(oPly,nil,nil,hdModel,hdPivot,enOrAngTr,ucsPosX,ucsPosY,ucsPosZ,ucsAngP,ucsAngY,ucsAngR)
end

local function GetEntityOrTrace(oEnt)
Expand Down
5 changes: 3 additions & 2 deletions lua/weapons/gmod_tool/stools/gearassembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local LocalPlayer = LocalPlayer
local GetConVar = GetConVar
local RunConsoleCommand = RunConsoleCommand
local osDate = os and os.date
local hookAdd = hook and hook.Add
local mathFloor = math and math.floor
local mathClamp = math and math.Clamp
local vguiCreate = vgui and vgui.Create
Expand Down Expand Up @@ -86,7 +87,7 @@ end

if(SERVER) then
cleanupRegister(gsLimitName)
hookAdd("PlayerDisconnected", gsToolPrefL.."player_quit", asmlib.GetActionCode("PLAYER_QUIT")))
hookAdd("PlayerDisconnected", gsToolPrefL.."player_quit", asmlib.GetActionCode("PLAYER_QUIT"))
duplicatorRegisterEntityModifier(gsToolPrefL.."dupe_phys_set",asmlib.GetActionCode("DUPE_PHYS_SETTINGS"))
end

Expand Down Expand Up @@ -715,7 +716,7 @@ function TOOL:DrawHUD()
else
local vPos = stTrace.HitPos
local aAng = asmlib.GetNormalAngle(oPly, stTrace)
local stSpawn = asmlib.GetNormalSpawn(oPly,vPos,aAng,model,rotpivh,trorang,nextx,nexty,nextz,nextpic,nextyaw,nextrol)
local stSpawn = asmlib.GetNormalSpawn(oPly,vPos,aAng,model,rotpivh,trorang,nextx,nexty,nextz,nextpic,nextyaw,nextrol)
if(not stSpawn) then return false end
local Op = self:DrawUCS(hudMonitor, stSpawn.OPos, stSpawn.F:AngleEx(stSpawn.U), plyrad, "y", true)
if(not spnflat) then
Expand Down

0 comments on commit 4935f04

Please sign in to comment.