GetOpponentsSectionFinishNode matching

This commit is contained in:
Dethrace Labs 2025-10-03 14:55:00 +13:00
parent d0253aa023
commit abb728db7c
1 changed files with 5 additions and 8 deletions

View File

@ -2941,11 +2941,7 @@ tS16 GetOpponentsSectionStartNode(tOpponent_spec* pOpponent_spec, tS16 pSection)
if (pSection >= 20000 && pSection - 20000 < pOpponent_spec->nnext_sections) {
section_no = pOpponent_spec->next_sections[pSection - 20000].section_no;
node_index_index = pOpponent_spec->next_sections[pSection - 20000].direction == 0;
// if (pSection - 20000 <= pOpponent_spec->nnext_sections) {
// return gProgram_state.AI_vehicles.path_sections[section_no].node_indices[node_index_index];
// }
return pOpponent_spec->nnext_sections >= pSection - 20000 ? gProgram_state.AI_vehicles.path_sections[section_no].node_indices[node_index_index] : -1;
// return -1;
}
dr_dprintf("BIG ERROR - GetOpponentsSectionStartNode() - section not found in next_section array for opponent %s", pOpponent_spec->car_spec->driver_name);
PDEnterDebugger("BIG ERROR - GetOpponentsSectionStartNode()");
@ -2959,12 +2955,13 @@ tS16 GetOpponentsSectionFinishNode(tOpponent_spec* pOpponent_spec, tS16 pSection
int node_index_index;
if (pSection >= 20000 && pSection - 20000 < pOpponent_spec->nnext_sections) {
return gProgram_state.AI_vehicles.path_sections[pOpponent_spec->next_sections[pSection - 20000].section_no].node_indices[pOpponent_spec->next_sections[pSection - 20000].direction];
section_no = pOpponent_spec->next_sections[pSection - 20000].section_no;
node_index_index = pOpponent_spec->next_sections[pSection - 20000].direction;
return gProgram_state.AI_vehicles.path_sections[section_no].node_indices[node_index_index];
}
dr_dprintf("BIG ERROR - GetOpponentsSectionFinishNode() - section not found in next_section array for opponent %s",
pOpponent_spec->car_spec->driver_name);
dr_dprintf("BIG ERROR - GetOpponentsSectionFinishNode() - section not found in next_section array for opponent %s", pOpponent_spec->car_spec->driver_name);
PDEnterDebugger("BIG ERROR - GetOpponentsSectionFinishNode()");
return 0;
return -1;
}
// IDA: br_vector3* __usercall GetOpponentsSectionStartNodePoint@<EAX>(tOpponent_spec *pOpponent_spec@<EAX>, tS16 pSection@<EDX>)