Исправления мелких багов

This commit is contained in:
2023-01-11 15:38:22 +03:00
parent 31f3f258f6
commit 0fb2f3b007
3 changed files with 58 additions and 24 deletions

12
utils.c
View File

@@ -445,10 +445,18 @@ void debug_print_robot_code(const struct robot_code *code, const short robot_id,
* опустить траверсу
* установить время ожидания барабана (для промывки 4а)
*/
void create_operation(struct robot_code *code, const short barrel_id, const short start_zone, const short dest_zone,
void create_operation(struct robot_code *code, short barrel_id, const short start_zone, const short dest_zone,
const short current_zone, const short robot_id) {
// создаем код транзакции, пока обычный
if (barrel_id >= BARRELS_COUNT) {
barrel_id = -1;
}
code->barrel_id = barrel_id;
if (barrel_id >= 0) {
barrels[barrel_id].flags.robot = robot_id;
}
short cmd_index = 0;
if (!one_robot_mode && !hla_night_mode) {
@@ -474,7 +482,7 @@ void create_operation(struct robot_code *code, const short barrel_id, const shor
}
// если ночной режим, то нужно сразу обновить флаг у барабана
if (hla_night_mode && barrel_id >= 0 && barrel_id < BARRELS_COUNT) {
if (hla_night_mode && barrel_id >= 0) {
barrels[barrel_id].flags.is_night = -1;
}