From 32bba9c88ae0466bdc8f4cb032df2079491efb0b Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Fri, 3 Oct 2025 22:31:13 +1300 Subject: [PATCH] RecalcNearestPathSectionWidth matching --- src/DETHRACE/common/opponent.c | 36 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/DETHRACE/common/opponent.c b/src/DETHRACE/common/opponent.c index b73e84d2..4a9a134f 100644 --- a/src/DETHRACE/common/opponent.c +++ b/src/DETHRACE/common/opponent.c @@ -3520,24 +3520,26 @@ void RecalcNearestPathSectionWidth(br_scalar pAdjustment) { br_scalar distance; char str[128]; - if (gOppo_paths_shown) { - if (!gAlready_elasticating) { - section_no = FindNearestPathSection(&gSelf->t.t.translate.t, &direction_v, &intersect, &distance); - if (distance > 10.f) { - NewTextHeadupSlot(eHeadupSlot_misc, 0, 2000, -1, "Can't find any paths close enough"); - return; - } - } else { - section_no = gMobile_section; - } - gProgram_state.AI_vehicles.path_sections[section_no].width += (int)pAdjustment * pAdjustment + pAdjustment; - if (gProgram_state.AI_vehicles.path_sections[section_no].width < .05f) { - gProgram_state.AI_vehicles.path_sections[section_no].width = .05f; - } - ShowOppoPaths(); - sprintf(str, "Width %2.1f BRU", 2.f * gProgram_state.AI_vehicles.path_sections[section_no].width); - NewTextHeadupSlot(eHeadupSlot_misc, 0, 2000, -1, str); + if (!gOppo_paths_shown) { + return; } + if (gAlready_elasticating) { + section_no = gMobile_section; + } else { + section_no = FindNearestPathSection(&gSelf->t.t.translate.t, &direction_v, &intersect, &distance); + if (distance > 10.f) { + NewTextHeadupSlot(eHeadupSlot_misc, 0, 2000, -1, "Can't find any paths close enough"); + return; + } + } + pAdjustment = (int)pAdjustment * pAdjustment + pAdjustment; + gProgram_state.AI_vehicles.path_sections[section_no].width += pAdjustment; + if (gProgram_state.AI_vehicles.path_sections[section_no].width < .05f) { + gProgram_state.AI_vehicles.path_sections[section_no].width = .05f; + } + ShowOppoPaths(); + sprintf(str, "Width %2.1f BRU", 2.0 * gProgram_state.AI_vehicles.path_sections[section_no].width); + NewTextHeadupSlot(eHeadupSlot_misc, 0, 2000, -1, str); } // IDA: void __usercall CalcNegativeXVector(br_vector3 *pNegative_x_vector@, br_vector3 *pStart@, br_vector3 *pFinish@, br_scalar pLength)