Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Cvar values set through cfg files include trailing comments

Open vrad-exe opened this issue 4 years ago • 3 comments

Describe the bug

If a cvar in a CFG file is followed by a comment, the cvar will be set to a string which includes the comment. For example:

sv_cheats 1 // Enable cheats on startup

will literally set the value of sv_cheats to 1 // Enable cheats on startup, rather than ignoring the comment (and preceding space) as expected.

For integer/float cvars everything still seems to work fine, but this causes a problem for cvars which take a string.

To Reproduce

  1. Put the command above in your autoexec
  2. Start the game
  3. Type sv_cheats into the console but don't hit enter, the autocomplete will show the bug

Expected Behavior

It should ignore the comment.

Operating System

Tested on Windows 10

vrad-exe avatar Nov 28 '21 05:11 vrad-exe

Still an issue image

vrad-exe avatar Dec 28 '22 05:12 vrad-exe

Still an issue on staging image

vrad-exe avatar Oct 16 '23 23:10 vrad-exe

Still an issue

vrad-exe avatar Aug 06 '24 04:08 vrad-exe