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

Array Function CBA_fnc_findMin is broken. #257

Closed
Sergeant-Rock opened this Issue Feb 7, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@Sergeant-Rock

In the function the variable _max need to be replaced with _min. I think this may havbe resulted from a copy/paste error with CBA_fnc_findMax. Simple fix.

I've highlighted in the current function the issues:

include "script_component.hpp"

SCRIPT(findMin);

private ["_index"];

if (!IS_ARRAY(_this)) exitWith {nil};
if (_this isEqualTo []) exitWith {nil};

params ["_min"];
_index = 0;

{
if (isNil "_x" || {(typeName _x) != (typeName 0)}) exitWith {_max = nil; _index = nil;};
if (_min > _x) then {_min = _x; _index = _forEachIndex};
} forEach _this;

if (isNil "_max") exitWith {nil};
[_min, _index] // Return

@Sergeant-Rock

This comment has been minimized.

Show comment
Hide comment
@Sergeant-Rock

Sergeant-Rock Feb 7, 2016

Great, I take it this will be in the next release? Thx.

Great, I take it this will be in the next release? Thx.

@jonpas

This comment has been minimized.

Show comment
Hide comment
@jonpas

jonpas Feb 7, 2016

Member

Yes it will be.

Member

jonpas commented Feb 7, 2016

Yes it will be.

@commy2 commy2 added the Bug label Feb 7, 2016

@commy2 commy2 added this to the 2.3 milestone Feb 7, 2016

@commy2 commy2 self-assigned this Feb 7, 2016

@commy2

This comment has been minimized.

Show comment
Hide comment
@commy2

commy2 Feb 7, 2016

Contributor

Close, because already fixed.

Contributor

commy2 commented Feb 7, 2016

Close, because already fixed.

@commy2 commy2 closed this Feb 7, 2016

@commy2

This comment has been minimized.

Show comment
Hide comment
@commy2

commy2 Feb 7, 2016

Contributor

ref: #207

Contributor

commy2 commented Feb 7, 2016

ref: #207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment