Problem with ?: operator and vectors

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

User avatar
Posts: 770
Joined: Wed May 05, 2010 12:16 pm

Problem with ?: operator and vectors

Postby Rado1 » 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.

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.

Return to “Bug reports”

Who is online

Users browsing this forum: No registered users and 1 guest