mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-02-14 18:10:05 +00:00
Remove legacy bHandleRawData check and fix file loading
While the check (most likely) wouldn't break anything, it's better to fix it and not worry then to not fix it and find out it breaks image loading. Also fixes how files are loaded.
This commit is contained in:
parent
71d024a76c
commit
11060596b1
@ -41,17 +41,17 @@ function loadImage( sPath )
|
||||
error( "bad argument #1 (expected string, got " .. type( sPath ) .. ")", 2 )
|
||||
end
|
||||
|
||||
if fs.exists( sPath ) and not bLoadRawData then
|
||||
if fs.exists( sPath ) then
|
||||
local tImage = {}
|
||||
local file = io.open( sPath, "r" )
|
||||
local sLine = file:read()
|
||||
local sContent = ""
|
||||
while sLine do
|
||||
sContent = sContent .. sLine .. "\n"
|
||||
sContent = sContent .. "\n" .. sLine
|
||||
sLine = file:read()
|
||||
end
|
||||
file:close()
|
||||
return parseImage( sContent ) -- delegate parsing of images to parseImage function as suggested by @SquidDev in discussion of PR #378
|
||||
return parseImage( sContent:sub(2) ) -- remove first newline and delegate parsing of images to parseImage function as suggested by @SquidDev in discussion of PR #378
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user