If the first value in OptionString is empty, INF is assigned

Sat Jul 04, 2020 6:03 am

If the first value in OptionString pair list is an empty string (""), Option entry with this OptionString displays "Unknown" and assigns "INF" to a corresponding CVar.

This issue is not critical. The workaround is simple: make the entry with an empty string not first.

Steps to reproduce:
  1. Load option-string-empty-string.pk3.
    option-string-empty-string.pk3

  2. Open Options menu. There are two option fields on the bottom: "This works" and "This doesn't work".

    Expected result: the value in "This doesn't work" option is either "empty" or "text".
    Actual result: the value is "Unknown".

  3. Change value of "This doesn't work" option.

    Expected result: the value switches between "empty" and "text", CVar value switches between "" and "text".
    Actual result: the value remains "Unknown", CVar value becomes "INF". The displayed text on "This works" option becomes "Unknown" too.

The contents of option-string-empty-string.pk3:
menudef.txt:
Code:
OptionString this_works
{
  "text" , "text"
  ""     , "empty"
}

OptionString this_does_not_work
{
  ""     , "empty"
  "text" , "text"
}

AddOptionMenu OptionsMenu
{
  Option "This works"        , bug_empty_string, this_works
  Option "This doesn't work" , bug_empty_string, this_does_not_work
}

cvarinfo.txt:
Code:
user string bug_empty_string = "text";


Edit: GZDoom 4.4.2.
You do not have the required permissions to view the files attached to this post.