ENTITY *nextObs == NULL;
void searchNextObs() {
if(event_type == EVENT_SCAN) {
if(nextObs == NULL) {
nextObst = me;
} else {
if(vec_dist(nextObst.x,you.x) > vec_dist(me.x,you.x)) { //if this obstacle is closer to the scanning entity than the saved obstacle
nextObs = me;
}
}
}
}
action act_obstacle() {
my.emask = ENABLE_SCAN;
my.event = searchNextObs;
}