may be,but you can make you'r code even shorter:
Code:
void main() {
	ENTITY* ent = NULL;
	if (ent && is(ent, FLAG1)) {
		beep();
	}
}