mirror of
https://gitlab.com/klmp200/LO41.git
synced 2025-07-10 11:49:24 +00:00
Oups
This commit is contained in:
@ -9,12 +9,15 @@ SETTER(SharedData, Building *, main_building)
|
||||
|
||||
int call_elevator_SharedData(THIS(SharedData), int starting_floor, int destination_floor){
|
||||
/* Make the thread wait for an elevator available and return the id of the elevator available */
|
||||
if (this->main_building == NULL)
|
||||
if (this->main_building == NULL) {
|
||||
CRASH("No building attached to shared data, you cannot call an elevator\n");
|
||||
if (starting_floor < 0)
|
||||
}
|
||||
if (starting_floor < 0) {
|
||||
CRASH("You cannot start from a floor lower than 0\n");
|
||||
if (destination_floor > FLOORS)
|
||||
}
|
||||
if (destination_floor > FLOORS) {
|
||||
CRASH("You are trying to reach a floor higher than the highest floor\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user