From 4b1afc161869dfa086fd4004eb671e505f87eab8 Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:08:46 +1300 Subject: [PATCH] ProcessCompleteRace matching --- src/DETHRACE/common/opponent.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/DETHRACE/common/opponent.c b/src/DETHRACE/common/opponent.c index b757676f..f2a85947 100644 --- a/src/DETHRACE/common/opponent.c +++ b/src/DETHRACE/common/opponent.c @@ -918,18 +918,13 @@ void ProcessCompleteRace(tOpponent_spec* pOpponent_spec, tProcess_objective_comm ShiftOpponentsProjectedRoute(pOpponent_spec, pOpponent_spec->follow_path_data.section_no - 20000); pOpponent_spec->follow_path_data.section_no = 20000; } - if (pOpponent_spec->nnext_sections != 0) { - res = ProcessFollowPath(pOpponent_spec, ePOC_run, 0, 0, 0); - if (res != eFPR_end_of_path) { - goto skip_new_objective; - } + + if (!pOpponent_spec->nnext_sections + || (res = ProcessFollowPath(pOpponent_spec, ePOC_run, 0, 0, 0)) == eFPR_end_of_path) { + dr_dprintf("%s: Giving up following race path because ran out of race path", pOpponent_spec->car_spec->driver_name); + NewObjective(pOpponent_spec, eOOT_get_near_player); } - dr_dprintf("%s: Giving up following race path because ran out of race path", pOpponent_spec->car_spec->driver_name); - NewObjective(pOpponent_spec, eOOT_get_near_player); - - skip_new_objective: - if (res != eFPR_OK) { if (res == eFPR_given_up) { dr_dprintf("%s: Giving up complete_race because ProcessFollowPath() gave up", pOpponent_spec->car_spec->driver_name);