Setting an ULX cvar now no longer needless routes the cvar change through the console.

This commit is contained in:
Nayruden 2017-03-21 14:45:21 -05:00
parent 0ff7bb365b
commit e470f8f76e
4 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# ULX Changelog
## v3.73 - *(00/00/00)*
* [CHANGE] Setting an ULX cvar now no longer needless routes the cvar change through the console.
## v3.72 - *(03/19/17)*
* [CHANGE] UTeam is now disabled for DarkRP gamemodes to prevent conflicts (Thanks, Bo98).

View File

@ -26,9 +26,9 @@ function ulx.convar( command, value, help, access )
-- table.insert( ulx.convarhelp[ currentCategory ], { cmd=command, access=access, help=help } ) -- TODO
local nospaceCommand = command:gsub( " ", "_" )
ulx.cvars[ command:lower() ] = { help=help, cvar=nospaceCommand, original=command }
local cvarName = "ulx_" .. nospaceCommand
local obj = ULib.replicatedWritableCvar( cvarName, cvarName, value, false, false, "ulx " .. command )
ulx.cvars[ command:lower() ] = { help=help, cvar=nospaceCommand, original=command, obj=obj }
return obj
end

View File

@ -99,7 +99,7 @@ local function cc_ulx( ply, command, argv )
-- But it's only the '%', or we'd use ULib.makePatternSafe instead of this.
ply:ConCommand( "ulx_" .. cvar.cvar .. " \"" .. args:gsub( "(%%)", "%%%1" ) .. "\"" )
else
RunConsoleCommand( "ulx_" .. cvar.cvar, argv[ 2 ] )
cvar.obj:SetString( argv[ 2 ] )
end
return
end

View File

@ -1 +1 @@
1489949356
1490125521