Skip to content

Commit

Permalink
Fixed: Strings to SQL conversion when building queries
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdvideo1234 committed Jan 17, 2016
1 parent 2d2ef31 commit c268c35
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lua/autorun/trackassembly_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ asmlib.SetIndexes("V",1,2,3)
asmlib.SetIndexes("A",1,2,3)
asmlib.SetIndexes("S",4,5,6,7)
asmlib.InitAssembly("track","assembly")
asmlib.SetOpVar("TOOL_VERSION","5.173")
asmlib.SetOpVar("TOOL_VERSION","5.174")
asmlib.SetOpVar("DIRPATH_BAS",asmlib.GetOpVar("TOOLNAME_NL")..asmlib.GetOpVar("OPSYM_DIRECTORY"))
asmlib.SetOpVar("DIRPATH_EXP","exp"..asmlib.GetOpVar("OPSYM_DIRECTORY"))
asmlib.SetOpVar("DIRPATH_DSV","dsv"..asmlib.GetOpVar("OPSYM_DIRECTORY"))
Expand Down
8 changes: 4 additions & 4 deletions lua/trackassembly/trackasmlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ function PointOffsetUp(oEnt,ivPointID)
local hdPnt = LocatePOA(hdRec,iPointID)
if(not IsExistent(hdPnt)) then
return StatusLog(nil,"PointOffsetUp: Point #"..tostring(iPointID)
.." not located on model <"..sModel..">") end
.." not located on model <"..sModel..">") end
if(not (hdPnt.O and hdPnt.A)) then
return StatusLog(nil,"PointOffsetUp: Invalid POA #"..tostring(iPointID).." for <"..sModel..">") end
local aDiffBB = Angle()
Expand Down Expand Up @@ -1163,7 +1163,7 @@ function ModelToName(sModel)
-- Trigger the capital-space using the divider
if(stringSub(gModel,1,1) ~= sSymDiv) then gModel = sSymDiv..gModel end
-- Here in gModel we have: _aaaaa_bbbb_ccccc
fCh, bCh, sModel = stringFind(gModel,sSymDiv,1), 1, ""
fCh, bCh, sModel = stringFind(gModel,sSymDiv,1), 1, ""
while(fCh) do
if(fCh > bCh) then
sModel = sModel..stringSub(gModel,bCh+2,fCh-1)
Expand Down Expand Up @@ -1721,7 +1721,7 @@ local function MatchType(defTable,snValue,ivIndex,bQuoted,sQuote,bStopRevise,bSt
if (defField[3] == "LOW") then snOut = stringLower(snOut)
elseif(defField[3] == "CAP") then snOut = stringUpper(snOut) end
if(not bStopRevise and sModeDB == "SQL" and defField[4] == "QMK") then
snOut = string.gsub(snOut,"'","''")
snOut = stringGsub(snOut,"'","''")
end
if(bQuoted) then
local sqChar
Expand Down Expand Up @@ -2464,7 +2464,7 @@ function CacheQueryAdditions(sModel)
return StatusLog(nil,"CacheQueryAdditions: Model {"..type(sModel).."}<"..tostring(sModel).."> not string") end
if(IsEmptyString(sModel)) then
return StatusLog(nil,"CacheQueryAdditions: Model empty string") end
if(not utilIsValidModel(sModel)) then
if(not utilIsValidModel(sModel)) then
return StatusLog(nil,"CacheQueryAdditions: Model invalid") end
local defTable = GetOpVar("DEFTABLE_ADDITIONS")
if(not defTable) then
Expand Down
32 changes: 16 additions & 16 deletions lua/weapons/gmod_tool/stools/trackassembly.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,6 @@ function TOOL:GetSurfaceSnap()
return (self:GetClientNumber("surfsnap") or 0)
end

function TOOL:ClearAnchor()
local svEnt = self:GetEnt(1)
local plPly = self:GetOwner()
if(svEnt and svEnt:IsValid()) then
svEnt:SetRenderMode(RENDERMODE_TRANSALPHA)
svEnt:SetColor(conPalette:Select("w"))
end
self:ClearObjects()
asmlib.PrintNotifyPly(plPly,"Anchor: Cleaned !","CLEANUP")
asmlib.ConCommandPly(plPly,"anchor",gsNoAnchor)
return asmlib.StatusLog(true,"TOOL:ClearAnchor(): Anchor cleared")
end

function TOOL:SetAnchor(stTrace)
self:ClearAnchor()
if(not stTrace) then return asmlib.StatusLog(false,"TOOL:SetAnchor(): Trace invalid") end
Expand All @@ -309,6 +296,19 @@ function TOOL:SetAnchor(stTrace)
return asmlib.StatusLog(true,"TOOL:SetAnchor("..sAnchor..")")
end

function TOOL:ClearAnchor()
local svEnt = self:GetEnt(1)
local plPly = self:GetOwner()
if(svEnt and svEnt:IsValid()) then
svEnt:SetRenderMode(RENDERMODE_TRANSALPHA)
svEnt:SetColor(conPalette:Select("w"))
end
self:ClearObjects()
asmlib.PrintNotifyPly(plPly,"Anchor: Cleaned !","CLEANUP")
asmlib.ConCommandPly(plPly,"anchor",gsNoAnchor)
return asmlib.StatusLog(true,"TOOL:ClearAnchor(): Anchor cleared")
end

function TOOL:GetAnchor()
local svEnt = self:GetEnt(1)
if(not (svEnt and svEnt:IsValid())) then svEnt = nil end
Expand Down Expand Up @@ -403,7 +403,7 @@ function TOOL:LeftClick(stTrace)

local trModel = trEnt:GetModel()
local fntrmod = stringToFileName(trModel)

-- No need stacking relative to non-persistent props or using them...
local trRec = asmlib.CacheQueryPiece(trModel)
local hdRec = asmlib.CacheQueryPiece(model)
Expand Down Expand Up @@ -449,7 +449,7 @@ function TOOL:LeftClick(stTrace)
end -- Validate existent next point ID
asmlib.UndoCratePly(gsUndoPrefN..fnmodel.." ( Stack #"..tostring(count).." )")
while(iNdex <= count) do
local sIterat = "["..tostring(iNdex).."]"
local sIterat = "["..tostring(iNdex).."]"
local errIter = gsErrorPad.."Iterats: "..sIterat
..gsErrorPad.."StackTr: "..tostring( iTrys ).." ?= "..tostring(staatts)
ePieceN = asmlib.MakePiece(model,trPos,ANG_ZERO,mass,bgskids,conPalette:Select("w"))
Expand Down Expand Up @@ -509,7 +509,7 @@ function TOOL:LeftClick(stTrace)
..gsErrorPad.."Event : Snap one piece relative to another"..errInfo)) then return false end
ePiece:SetAngles(stSpawn.SAng)
if(not asmlib.ApplyPhysicalSettings(ePiece,ignphysgn,freeze,gravity,physmater)) then
return asmlib.StatusLog(false,"TOOL:LeftClick(Snap): Failed to apply physical settings on snapping"..errInfo) end
return asmlib.StatusLog(false,"TOOL:LeftClick(Snap): Failed to apply physical settings on snapping"..errInfo) end
if(not asmlib.ApplyPhysicalAnchor(ePiece,(anEnt or trEnt),weld,nil)) then -- Weld all created to the anchor/previous
return asmlib.StatusLog(false,"TOOL:LeftClick(Snap): Failed to apply weld on snapping"..errInfo) end
if(not asmlib.ApplyPhysicalAnchor(ePiece,trEnt,nil,nocollide)) then -- NoCollide all to previous
Expand Down

0 comments on commit c268c35

Please sign in to comment.