mirror of
https://gitlab.com/klmp200/LO41.git
synced 2024-11-21 16:23:22 +00:00
les ascensceurs bougent, promis
This commit is contained in:
parent
7fcb2a8b5a
commit
e7601243fa
@ -69,7 +69,7 @@ int get_next_floor_Elevator(THIS(Elevator)){
|
||||
temp_element = this->passengers->get_element(this->passengers, i);
|
||||
temp_passenger = (Passenger*) temp_element->get_data(temp_element);
|
||||
temp_floor = temp_passenger->type == RESIDENT ? temp_passenger->resident->destination : temp_passenger->visitor->destination;
|
||||
if(abs(this->floor - temp_floor) < min_diff){
|
||||
if(abs(this->floor - temp_floor) < min_diff && temp_floor != this->floor){
|
||||
min_diff = abs(this->floor - temp_floor);
|
||||
next_floor = temp_floor;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user