check if there are enemies/friendlies before iterating