From fa6a0287cdeaeba030252c15f16a46be1dae7d73 Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Fri, 3 Oct 2025 15:14:17 +1300 Subject: [PATCH] GetOpponentsSectionMinSpeed effectively matching --- src/DETHRACE/common/opponent.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/DETHRACE/common/opponent.c b/src/DETHRACE/common/opponent.c index e8bdd51c..d729c5f7 100644 --- a/src/DETHRACE/common/opponent.c +++ b/src/DETHRACE/common/opponent.c @@ -3031,12 +3031,10 @@ int GetOpponentsSectionMinSpeed(tOpponent_spec* pOpponent_spec, tS16 pSection, i if (pSection >= 20000 && pSection - 20000 < pOpponent_spec->nnext_sections) { section_no = pOpponent_spec->next_sections[pSection - 20000].section_no; direction = pOpponent_spec->next_sections[pSection - 20000].direction; - return gProgram_state.AI_vehicles.path_sections[section_no].min_speed[pTowards_finish == direction]; - } - if (pSection >= 15000) { + return gProgram_state.AI_vehicles.path_sections[section_no].min_speed[(direction ^ pTowards_finish) == 0]; + } else if (pSection >= 15000) { return 0; - } - if (pSection == 10000) { + } else if (pSection == 10000) { return pOpponent_spec->pursue_car_data.direct_line_section.min_speed[pTowards_finish]; } dr_dprintf("WARNING - GetOpponentsSectionMinSpeed() - section not found in next_section array for opponent %s", pOpponent_spec->car_spec->driver_name);