mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/DataStores: Fixed loading empty db2 files
This commit is contained in:
@@ -601,10 +601,14 @@ char* DB2FileLoaderRegularImpl::AutoProduceStrings(char** indexTable, uint32 ind
|
||||
|
||||
void DB2FileLoaderRegularImpl::AutoProduceRecordCopies(uint32 records, char** indexTable, char* dataTable)
|
||||
{
|
||||
uint32 recordCopies = GetRecordCopyCount();
|
||||
if (!recordCopies)
|
||||
return;
|
||||
|
||||
uint32 recordsize = _loadInfo->Meta->GetRecordSize();
|
||||
uint32 offset = _header->RecordCount * recordsize;
|
||||
uint32 idFieldOffset = _loadInfo->Meta->HasIndexFieldInData() ? GetFieldOffset(_loadInfo->Meta->GetIndexField()) : 0;
|
||||
for (uint32 c = 0; c < GetRecordCopyCount(); ++c)
|
||||
for (uint32 c = 0; c < recordCopies; ++c)
|
||||
{
|
||||
DB2RecordCopy copy = GetRecordCopy(c);
|
||||
if (copy.SourceRowId && copy.SourceRowId < records && copy.NewRowId < records && indexTable[copy.SourceRowId])
|
||||
@@ -1306,10 +1310,14 @@ char* DB2FileLoaderSparseImpl::AutoProduceStrings(char** indexTable, uint32 inde
|
||||
|
||||
void DB2FileLoaderSparseImpl::AutoProduceRecordCopies(uint32 records, char** indexTable, char* dataTable)
|
||||
{
|
||||
uint32 recordCopies = GetRecordCopyCount();
|
||||
if (!recordCopies)
|
||||
return;
|
||||
|
||||
uint32 recordsize = _loadInfo->Meta->GetRecordSize();
|
||||
uint32 offset = _header->RecordCount * recordsize;
|
||||
uint32 idFieldOffset = _loadInfo->Meta->HasIndexFieldInData() ? _loadInfo->Meta->GetIndexFieldOffset() : 0;
|
||||
for (uint32 c = 0; c < GetRecordCopyCount(); ++c)
|
||||
for (uint32 c = 0; c < recordCopies; ++c)
|
||||
{
|
||||
DB2RecordCopy copy = GetRecordCopy(c);
|
||||
if (copy.SourceRowId && copy.SourceRowId < records && copy.NewRowId < records && indexTable[copy.SourceRowId])
|
||||
|
||||
Reference in New Issue
Block a user