any cond(bool condition, any a, any b)
condition is true, it returns a, otherwise it returns b.
The only difference is that all arguments are evaluated before the function is called. This means that
cond(x, f(), g()) will call both
x ? f() : g() will call only one of them.
int color = CR_RED; if (PlayerTeam() == TEAM_BLUE) color = CR_BLUE; DrawSomething(color);
DrawSomething(cond(PlayerTeam() == TEAM_BLUE, CR_BLUE, CR_RED));