Я хочу интерактивно добавить это подвешивало редактирование:Ошибка: «патч не применяется» при редактировании подвешенного в режиме патча
@@ -55,3 +50,28 @@
{
- if(n_arguments == 1)
+ inputed_command = get_line(); //gets the user's input line from the stdin.
+
+ //we edit the user's input as needed according to qtp rules.
+ /*STRING EDITING FUNCTIONS*/
+ replace_string_chars(inputed_command, 9, ' ');
+ remove_char(inputed_command, 13);
+ remove_comments(inputed_command);
+ remove_extra_spaces(inputed_command);
+ uncapitalize(inputed_command);
+ /*END OF STRING EDITING FUNCTIONS*/
+
+ //the command gets seperated from the user's input ex. playmove w c3, here the command is playmove.
+ command = command_decode(inputed_command);
+ //the arguments are seperated from the user's input in an 2D array ex. playmove w c3, here the arguments are w and c3.
+ arguments = arguments_decode(inputed_command, &n_arguments);
+
+ //the user specified command is executed by matching the user's command with the engine's available commands. if the user's command is not one of the engine's known commands then a descriptive error is printed.
+ if(strcmp(command, "name") == 0)
+ name();
+ else if(strcmp(command, "known_command") == 0)
+ known_command(arguments, n_arguments);
+ else if(strcmp(command, "list_commands") == 0)
+ list_commands();
+ else if(strcmp(command, "quit") == 0)
+ quit(&quit_game);
+ else if(strcmp(command, "boardsize") == 0)
{
Я хотел бы поставить эту часть только:
@@ -55,3 +50,28 @@
{
- if(n_arguments == 1)
+ inputed_command = get_line(); //gets the user's input line from the stdin.
+
+ //we edit the user's input as needed according to qtp rules.
+ /*STRING EDITING FUNCTIONS*/
+ replace_string_chars(inputed_command, 9, ' ');
+ remove_char(inputed_command, 13);
+ remove_comments(inputed_command);
+ remove_extra_spaces(inputed_command);
+ uncapitalize(inputed_command);
+ /*END OF STRING EDITING FUNCTIONS*/
+
+ //the command gets seperated from the user's input ex. playmove w c3, here the command is playmove.
+ command = command_decode(inputed_command);
+ //the arguments are seperated from the user's input in an 2D array ex. playmove w c3, here the arguments are w and c3.
+ arguments = arguments_decode(inputed_command, &n_arguments);
+
{
, но когда я сэкономю & выход этой ошибки происходит «патч не применяется».
Я читал, что мне нужно редактировать числа между символами @@, но я никогда не получаю это правильно. Пожалуйста, опишите, как решить эту ошибку, спасибо.
Я удалил ненужные добавленные строки и фигурные скобки, которые были неуместны и по-прежнему получили ту же ошибку. Нет, я не думаю, что мой редактор применяет правила автоматического форматирования. –
@PlatwnAce Это тоже похоже на меня. Отступ фигурной скобки выглядит неправильно в оригинале. (Если это просто артефакт того, как это было отправлено в StackOverflow, исправьте его. Для этого типа вопроса важна точность символов для персонажа.) – Kaz
@Kaz Да, это был артефакт. Извините за путаницу. Теперь это исправлено. –