Make CreateClientConVar support help text #1134

Merged
merged 1 commit into from Mar 11, 2016

Projects

None yet

4 participants

@Kefta
Contributor
Kefta commented Feb 23, 2016

No description provided.

@neico
Contributor
neico commented Feb 23, 2016

What happens when you use CreateClientConVar( "convar", "0" ), my guess is that it'll create a error (or echo "nil" as helptext) because helptext has no fail safe, change the CreateConVar call to ( helptext or "" ) to be sure (or use a local helptext = helptext || "", depending on which behavior I mentioned is observed)

@bmwalters
Contributor

Seeing as nil is passed when the argument is not provided and it's an optional arg, it should not error.

@neico
Contributor
neico commented Feb 23, 2016

Hmm might be that I'm thinking too much in C++ / PHP terms.

@Kefta
Contributor
Kefta commented Feb 23, 2016

Already tested. Passing nil as latter arguments has no effect in Lua, regardless if it's crossing the C++ boundry

@willox
Collaborator
willox commented Feb 23, 2016

Depending on the function's implementation it actually can, but not in this case.

@willox willox merged commit c6e45c4 into garrynewman:master Mar 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment