Fixed isValidColorArray returning true when array had the right size, but wrong datatypes/value ranges

This commit is contained in:
Michael Braun 2015-08-10 20:32:26 +02:00
parent 3e82391a36
commit a315596c5a

View File

@ -15,6 +15,8 @@
*/
#include "script_component.hpp"
scopeName "main";
params ["_colorArray"];
if (isNil "_colorArray") exitWith {false};
@ -22,7 +24,7 @@ if ((typeName _colorArray) != "ARRAY") exitWith {false};
if (count _colorArray != 4) exitWith {false};
{
if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false};
if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false breakOut "main"};
} count _colorArray;
true