diff --git a/Building/Building.c b/Building/Building.c index b2b3735..d859b2d 100644 --- a/Building/Building.c +++ b/Building/Building.c @@ -166,7 +166,8 @@ void go_to_floor_Building(THIS(Building), int origin, int destination, Passenger if (origin < 0 || origin >= FLOORS) {CRASH("You are trying to start from a non existing floor\n");} if (destination < 0 || destination >= FLOORS) {CRASH("You are trying to reach a non existing floor\n");} - this->waiting_passengers->insert_tail(this->waiting_passengers, (void*) &passenger, sizeof(passenger)); + //if(this->waiting_passengers->compare(this->waiting_passengers, (void*) &passenger, passenger.compare)) + this->waiting_passengers->insert_tail(this->waiting_passengers, (void*) &passenger, sizeof(passenger));//todo : check if inside list pthread_cond_wait(this->condition_floors[origin], this->mutex_cond_get_inside_elevator); elevator_number = this->get_inside_elevator(this, origin, passenger); diff --git a/Visitor/Visitor.c b/Visitor/Visitor.c index 0cf4ccd..ce93c42 100644 --- a/Visitor/Visitor.c +++ b/Visitor/Visitor.c @@ -14,7 +14,7 @@ void * runnable_Visitor(void * void_this){ SharedData * data = GET_INSTANCE(SharedData); Passenger passenger; - AGENT_OPTIONS + AGENT_OPTIONS; passenger.visitor = this; passenger.type = VISITOR;