Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type bug in gui_createCategory.sqf #1295

Closed
dpottavio opened this issue Feb 11, 2020 · 3 comments · Fixed by #1296
Closed

Type bug in gui_createCategory.sqf #1295

dpottavio opened this issue Feb 11, 2020 · 3 comments · Fixed by #1296
Assignees
Labels
Milestone

Comments

@dpottavio
Copy link

dpottavio commented Feb 11, 2020

Mods (complete and add to the following information):

  • Arma 3: latest
  • CBA: 0464ca4

Description:
I am getting type error messages from settings\gui_createCategory.sqf when non-numeric values are added to a LIST setting. The root cause of this seems to be a variable-type bug where a potentially non-numeric value is passed to param. It looks like this was introduced recently as part of a localization update.

Below is the line causing the issue. In line 139, _defaultValue should probably be _defaultValueIndex, as _defaultValue could be a string.

private _label = (_settingData param [1, []]) param [_defaultValue, ""];

This doesn't seem to be causing any major impact to the mission other than the settings tool-tip, but I'm not 100% certain of that.

Steps to reproduce:
Add values to a LIST setting that are not numeric.

// generates error message
[
    "foo setting",
    "LIST",
    ["my setting", ""],
    "my category",
    [["a", "b", "c"], ["A", "B", "C"],  0],
    true
] call CBA_settings_fnc_init;

// does not generate error message
[
    "foo setting",
    "LIST",
    ["my setting", ""],
    "my category",
    [[0, 1, 2], ["A", "B", "C"],  0],
    true
] call CBA_settings_fnc_init;

Expected behavior:
No error messages.

Where did the issue occur?

  • Dedicated
  • Multiplayer
  • Singleplayer

Log Files:

if (isLocali>
23:17:01   Error Type String, expected Number
23:17:01 File x\cba\addons\settings\gui_createCategory.sqf..., line 139
23:17:01 Error in expression <e _label = (_settingData param [1, []]) param [_defaultValue, ""];
@commy2
Copy link
Contributor

commy2 commented Feb 11, 2020

Which setting? Can you give an example to reproduce?

@dpottavio
Copy link
Author

Which setting? Can you give an example to reproduce?

This is happening on settings for my mission, but you can reproduce this by creating a LIST setting with non-numeric values. I updated the description with an example.

@commy2 commy2 added this to the 3.15 milestone Feb 11, 2020
@commy2 commy2 self-assigned this Feb 11, 2020
@commy2
Copy link
Contributor

commy2 commented Feb 11, 2020

private _label = (_settingData param [1, []]) param [_defaultValue, ""];

->

private _label = _settingData param [1, []] param [_settingData param [0, []] find _defaultValue, ""];

I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants