diff --git a/src/DETHRACE/common/opponent.c b/src/DETHRACE/common/opponent.c index 5476fce0..8aa802df 100644 --- a/src/DETHRACE/common/opponent.c +++ b/src/DETHRACE/common/opponent.c @@ -2940,11 +2940,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()"); @@ -2958,12 +2954,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@(tOpponent_spec *pOpponent_spec@, tS16 pSection@)