mirror of
https://gitlab.com/klmp200/LO41.git
synced 2025-07-12 04:39:23 +00:00
fixed a bug. I think ???
This commit is contained in:
@ -204,13 +204,6 @@ void go_to_floor_Building(THIS(Building), int origin, int destination, Passenger
|
||||
elevator_number = this->get_inside_elevator(this, origin, passenger);
|
||||
if (elevator_number != -1){ //passenger accepted in elevator
|
||||
this->waiting_floors[origin]--;//on retire de la liste des attentes
|
||||
if (passenger->type == RESIDENT)
|
||||
printf("Le résident %s rentre dans l'ascenseur %s depuis l'étage %d\n", passenger->get_name(passenger),
|
||||
this->elevators[elevator_number]->name, origin);
|
||||
else if (passenger->type == VISITOR)
|
||||
printf("Le visiteur %s rentre dans l'ascenseur %s depuis l'étage %d\n", passenger->get_name(passenger),
|
||||
this->elevators[elevator_number]->name, origin);
|
||||
|
||||
pthread_cond_wait(this->condition_floors[destination], this->mutex_cond_get_outside_elevator);
|
||||
this->elevators[elevator_number]->remove_passenger(this->elevators[elevator_number], passenger);
|
||||
}else{
|
||||
@ -219,7 +212,7 @@ void go_to_floor_Building(THIS(Building), int origin, int destination, Passenger
|
||||
else if (passenger->type == VISITOR)
|
||||
printf("Le visiteur %s à l'étage %d n'a pas pu rentrer dans un ascenseur. Préempté !\n", passenger->get_name(passenger), origin);
|
||||
//reloading fire
|
||||
//this->go_to_floor(this, origin, destination, passenger);
|
||||
this->go_to_floor(this, origin, destination, passenger);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user