mirror of
https://github.com/dvdvideo1234/TrackAssemblyTool.git
synced 2025-03-04 03:13:32 -05:00
Fixed: Issue #39 reading a file returns nil being trimmed
This commit is contained in:
parent
52a91beb07
commit
a673b69fa0
@ -91,7 +91,7 @@ local asmlib = trackasmlib; if(not asmlib) then -- Module present
|
||||
------------ CONFIGURE ASMLIB ------------
|
||||
|
||||
asmlib.InitBase("track","assembly")
|
||||
asmlib.SetOpVar("TOOL_VERSION","8.688")
|
||||
asmlib.SetOpVar("TOOL_VERSION","8.689")
|
||||
asmlib.SetIndexes("V" ,1,2,3)
|
||||
asmlib.SetIndexes("A" ,1,2,3)
|
||||
asmlib.SetIndexes("WV",1,2,3)
|
||||
|
@ -564,15 +564,18 @@ function GetViewRadius(pPly, vPos, nMul)
|
||||
end
|
||||
|
||||
--[[
|
||||
* Golden retriever. Retrieves file line as string
|
||||
* But seriously returns the sting line and EOF flag
|
||||
* pFile > The file to read the line of characters from
|
||||
* bCons > Keeps data consistency. Enable to ignore trimming
|
||||
* Golden retriever. Retrieves file line as string
|
||||
* But seriously returns the sting line and EOF flag
|
||||
* pFile > The file to read the line of characters from
|
||||
* bCons > Keeps data consistency. Enable to skip trim
|
||||
* Reurns line contents and reaching EOF flag
|
||||
* sLine > The line being read from the file
|
||||
* isEOF > Flag indicating pointer reached EOF
|
||||
]]
|
||||
function GetStringFile(pFile, bCons)
|
||||
if(not pFile) then LogInstance("No file"); return "", true end
|
||||
local sLine = pFile:ReadLine() -- Read one line at once
|
||||
local isEOF = pFile:EndOfFile() -- Check for EOF status
|
||||
local sLine = (pFile:ReadLine() or "") -- Read one line at once
|
||||
local isEOF = pFile:EndOfFile() -- Check for file EOF status
|
||||
if(not bCons) then sLine = sLine:Trim() end
|
||||
return sLine, isEOF
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user