Page 1 of 1

Problem with ?: operator and vectors

Posted: Sat Nov 15, 2014 8:24 am
by Rado1
If ternary conditional operator ( ?: ) is used for assignment to a vector variable, ZGE reports "Identifier is not an array:" syntax error.

Code: Select all

// works correctly
RenderSetColorA.Color = vector3(0, 0, 1);

// throws "Identifier is not an array:" syntax error
RenderSetColorA.Color = 1 ? vector3(1, 0, 0) : vector3(0, 0, 1);
There is maybe some incorrect type inference for ?: operator in parser (?). This is not a big problem, because if-then-else statement can be used instead... but would be nice to have this option in scripting language.