Small fix for saving to empty configs.

This commit is contained in:
Nayruden 2016-01-30 15:04:24 -05:00
parent a4440c49bc
commit 7083fc6662
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ function cvarChanged( sv_cvar, cl_cvar, ply, old_value, new_value )
local config = ULib.fileRead( path )
config, found = config:gsub( ULib.makePatternSafe( sv_cvar ):gsub( "%a", function( c ) return "[" .. c:lower() .. c:upper() .. "]" end ) .. "%s+[^;\r\n]*", replacement ) -- The gsub makes us case neutral
if found == 0 then -- Configuration option does not exist in config- append it
newline = config:match("\r?\n")
newline = config:match("\r?\n") or "\n"
if not config:find("\r?\n$") then config = config .. newline end
config = config .. "ulx " .. replacement .. "; " .. ulx.cvars[ command ].help .. newline
end

View File

@ -1 +1 @@
1454184243
1454184264