Skip to content

Commit

Permalink
fix importing for newer versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Deamon87 committed Mar 19, 2024
1 parent 1f463eb commit bdfca58
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fileReaders/WDC3/DB2Ver3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ void DB2Ver3::process(HFileContent db2File, const std::string &fileName) {
}
}
}
// readValues(common_data, );

//Read section
sections.resize(headerContent->section_count);
Expand Down Expand Up @@ -292,7 +291,12 @@ std::shared_ptr<DB2Ver3::WDC3RecordSparse> DB2Ver3::getSparseRecord(int recordIn
auto &sectionContent = sections[sectionIndex];
auto &sectionHeader = section_headers[sectionIndex];

int recordId = sectionContent.offset_map_id_list[indexWithinSection];
bool useOffsetMapId = (this->headerContent->flags.flag0x2 == 0) && sectionHeader.offset_map_id_count > 0;

int recordId = useOffsetMapId ?
sectionContent.offset_map_id_list[indexWithinSection] :
sectionContent.id_list[indexWithinSection];

unsigned char *recordPointer =
sectionContent.variable_record_data
+ sectionContent.offset_map[indexWithinSection].offset
Expand Down Expand Up @@ -380,7 +384,7 @@ DB2Ver3::WDC3Record::WDC3Record(std::shared_ptr<DB2Ver3 const> db2Class, int rec
recordPointer(recordPointer), sectionIndex(sectionIndex)
{
if (!db2Class->getWDCHeader()->flags.hasNonInlineId) {
auto result = getField(db2Class->getWDCHeader()->id_index, 0, 0);
auto result = getField(db2Class->getWDCHeader()->id_index, -1, -1);
this->recordId = result[0].v32s;
}

Expand Down

0 comments on commit bdfca58

Please sign in to comment.