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

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

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

Postby m8f » 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: Select allExpand view
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: Select allExpand view
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.
User avatar
m8f
dreamer
 
 
 
Joined: 29 Dec 2017
Location: Siberia (UTC+7)
Discord: m8f#0629
Github ID: mmaulwurff

Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest