Skip to content

Commit

Permalink
MSG patching: Increment the line counter correctly to repair hard lin…
Browse files Browse the repository at this point in the history
…e patching.

What the hell?!? Dialog patching in th06, th07 and parts of th08 was completely broken as a result, since state->cur_line was at set to at least 1, thus completely skipping the first line...
  • Loading branch information
nmlgc committed Feb 1, 2014
1 parent a659bdb commit 4483137
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions thcrap_tsa/src/th06_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,15 @@ int process_line(th06_msg_t *cmd_out, patch_msg_state_t *state, ReplaceFunc_t re
}

if(json_is_array(state->diff_lines)) {
const char *json_line = json_array_get_string(state->diff_lines, state->cur_line++);
if(validate_line(json_line)) {
const char *json_line = json_array_get_string(state->diff_lines, state->cur_line);
int ret = validate_line(json_line);
if(ret) {
rep_func(cmd_out, state, json_line);
state->last_line_cmd = cmd_out;
state->last_line_op = cur_op;
return 1;
}
// Line not present in the patch file, remove it
return 0;
state->cur_line++;
return ret;
}
// If this dialog box contains no lines to patch, take original line
return 1;
Expand Down

0 comments on commit 4483137

Please sign in to comment.