Fix statBarStatement still using AI values for firemodes (#7163)

This commit is contained in:
PabstMirror 2019-09-05 15:48:49 -05:00 committed by GitHub
commit 9d0e474cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,18 +18,19 @@
params ["_stat", "_config", "_args"]; params ["_stat", "_config", "_args"];
_args params ["_statMinMax", "_barLimits"]; _args params ["_statMinMax", "_barLimits"];
TRACE_4("statBarStatement_accuracy",_stat,_config,_statMinMax,_barLimits);
private _fireModes = getArray (_config >> "modes"); private _fireModes = getArray (_config >> "modes");
private _dispersion = []; private _dispersion = [];
{ {
if (getNumber (_config >> _x >> "showToPlayer") != 0) then {
private _n = log (getNumber (_config >> _x >> "dispersion")); private _n = log (getNumber (_config >> _x >> "dispersion"));
if (!finite _n) then {_n = 0;}; if (!finite _n) then {_n = 0;};
_dispersion pushBackUnique _n; _dispersion pushBackUnique _n;
};
} foreach _fireModes; } foreach _fireModes;
_dispersion sort true; _dispersion sort true;
TRACE_1("",_dispersion);
linearConversion [_statMinMax select 0, _statMinMax select 1, _dispersion param [0, 0], _barLimits select 0, _barLimits select 1] linearConversion [_statMinMax select 0, _statMinMax select 1, _dispersion param [0, 0], _barLimits select 0, _barLimits select 1]