The manual says that this is "good" because the program checks the whole comparision before deciding if it is true or false.

Code:
ENTITY * ent;

void main()
{
	if(ent && ent.x > 5)
		ent.x = 0;
}



this will result in an error.

ent doesn't exist so if you check if(ent) it is true.
but in the comparison above the program doesn't abort it but checks the next comparison (ent.x > 5)
but ent doesn't exist and this causes an error.

edit: note that this only applies for pointers.

Last edited by Kartoffel; 06/18/13 17:51.

POTATO-MAN saves the day! - Random