Aktualizovat du6/a_station.c
This commit is contained in:
parent
2ad320200e
commit
1ece09f5e6
@ -54,7 +54,7 @@ int select_track(struct station* station, const char* target)
|
|||||||
void add_target_capacity(struct station* station,const char* target, int capacity)
|
void add_target_capacity(struct station* station,const char* target, int capacity)
|
||||||
{
|
{
|
||||||
//helper lok. premeny
|
//helper lok. premeny
|
||||||
int i = select_track(station, target);
|
int i = select_track(station, target); //vyber track
|
||||||
struct car* current = station->tracks[i];
|
struct car* current = station->tracks[i];
|
||||||
int lastPosIndex = TARGET_SIZE - 1; //index s poziciou null terminatora
|
int lastPosIndex = TARGET_SIZE - 1; //index s poziciou null terminatora
|
||||||
|
|
||||||
@ -77,8 +77,8 @@ void add_target_capacity(struct station* station,const char* target, int capacit
|
|||||||
newCar->capacity = capacity;
|
newCar->capacity = capacity;
|
||||||
|
|
||||||
//vlozi na zaciatok tracku
|
//vlozi na zaciatok tracku
|
||||||
new_car->next = station->tracks[index];
|
new_car->next = station->tracks[i];
|
||||||
station->tracks[index] = new_car;
|
station->tracks[i] = new_car;
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_target_capacity(struct station* station,const char* target)
|
int get_target_capacity(struct station* station,const char* target)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user