Problem with ?: operator and vectors
Posted: Sat Nov 15, 2014 8:24 am
If ternary conditional operator ( ?: ) is used for assignment to a vector variable, ZGE reports "Identifier is not an array:" syntax error.
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.
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);