From a33deb7129a4fe7013d839ac0320a8b41e5a85e3 Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:55:20 +1200 Subject: [PATCH] ShiftOpponentsProjectedRoute effectively matching --- src/DETHRACE/common/opponent.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/DETHRACE/common/opponent.c b/src/DETHRACE/common/opponent.c index 5b480b0f..33ccc364 100644 --- a/src/DETHRACE/common/opponent.c +++ b/src/DETHRACE/common/opponent.c @@ -859,15 +859,16 @@ int AddToOpponentsProjectedRoute(tOpponent_spec* pOpponent_spec, tS16 pSection_n int ShiftOpponentsProjectedRoute(tOpponent_spec* pOpponent_spec, int pPlaces) { int i; - if (pOpponent_spec->nnext_sections <= pPlaces) { + if (pOpponent_spec->nnext_sections > pPlaces) { + for (i = 0; i < COUNT_OF(pOpponent_spec->next_sections) - pPlaces; i++) { + pOpponent_spec->next_sections[i].section_no = pOpponent_spec->next_sections[pPlaces + i].section_no; + pOpponent_spec->next_sections[i].direction = pOpponent_spec->next_sections[pPlaces + i].direction; + } + pOpponent_spec->nnext_sections -= pPlaces; + return 1; + } else { return 0; } - for (i = 0; i < COUNT_OF(pOpponent_spec->next_sections) - pPlaces; i++) { - pOpponent_spec->next_sections[i].section_no = pOpponent_spec->next_sections[pPlaces + i].section_no; - pOpponent_spec->next_sections[i].direction = pOpponent_spec->next_sections[pPlaces + i].direction; - } - pOpponent_spec->nnext_sections -= pPlaces; - return 1; } // IDA: void __usercall StunTheBugger(tOpponent_spec *pOpponent_spec@, int pMilliseconds@)