Skip to content
Snippets Groups Projects

Let Lua cvars use preset values in addition to MIN and MAX

Merged James R. requested to merge lua-minmax-plus into next

This is functionality that is already present in hardcode, but that Lua could not take advantage of due to preset values being allocated with a table. (Table keys do not have guaranteed order in Lua.)

Try it out:

CV_RegisterVar({ 'yes', '1', CV_NETVAR, {
	MIN = 1,
	MAX = 99,
	chad = 0,
}})

Additionally, this branch disallows cvars to be registered if they have only one of the MIN or MAX values. This is implied to not be allowed in the code anyway.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading