1
0
mirror of https://gitlab.com/klmp200/LO41.git synced 2025-07-12 04:39:23 +00:00

elevators are now working correctly when full

This commit is contained in:
Aethor
2018-06-22 01:26:00 +02:00
parent 86dabd455a
commit fe32aba7c8
2 changed files with 29 additions and 16 deletions

View File

@ -31,7 +31,7 @@ int get_next_call_Building(THIS(Building), int elevator_floor){
int next_target = -1;
for(i=0; i<FLOORS; i++){
if(waiting_floors[i] > 0){
if(abs(elevator_floor - i) < best_diff){
if(abs(elevator_floor - i) < best_diff && elevator_floor != i/*beware*/){
best_diff = abs(elevator_floor - i);
next_target = i;
}