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

Array Function CBA_fnc_findMin is broken. #257

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

Array Function CBA_fnc_findMin is broken. #257

Sergeant-Rock opened this issue Feb 7, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@Sergeant-Rock
Copy link

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

@jokoho48
Copy link
Member

jokoho48 commented Feb 7, 2016

@Sergeant-Rock
Copy link
Author

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

@jonpas
Copy link
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
Copy link
Contributor

commy2 commented Feb 7, 2016

Close, because already fixed.

@commy2 commy2 closed this as completed Feb 7, 2016
@commy2
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

4 participants