mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-26 08:29:21 -04:00
Core/DataStores: Implemented uint64 field type for DBC files and fixed structure of Achievement_Criteria.dbc
This commit is contained in:
@@ -90,8 +90,10 @@ bool DBCFileLoader::Load(const char* filename, const char* fmt)
|
||||
for (uint32 i = 1; i < fieldCount; ++i)
|
||||
{
|
||||
fieldsOffset[i] = fieldsOffset[i - 1];
|
||||
if (fmt[i - 1] == 'b' || fmt[i - 1] == 'X') // byte fields
|
||||
if (fmt[i - 1] == FT_BYTE || fmt[i - 1] == FT_NA_BYTE) // byte fields
|
||||
fieldsOffset[i] += sizeof(uint8);
|
||||
else if (fmt[i - 1] == FT_LONG)
|
||||
fieldsOffset[i] += sizeof(uint64);
|
||||
else // 4 byte fields (int32/float/strings)
|
||||
fieldsOffset[i] += sizeof(uint32);
|
||||
}
|
||||
@@ -152,6 +154,9 @@ uint32 DBCFileLoader::GetFormatRecordSize(const char* format, int32* index_pos)
|
||||
case FT_BYTE:
|
||||
recordsize += sizeof(uint8);
|
||||
break;
|
||||
case FT_LONG:
|
||||
recordsize += sizeof(uint64);
|
||||
break;
|
||||
case FT_NA:
|
||||
case FT_NA_BYTE:
|
||||
break;
|
||||
@@ -242,6 +247,10 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
|
||||
*((uint8*)(&dataTable[offset])) = getRecord(y).getUInt8(x);
|
||||
offset += sizeof(uint8);
|
||||
break;
|
||||
case FT_LONG:
|
||||
*((uint64*)(&dataTable[offset])) = getRecord(y).getUInt64(x);
|
||||
offset += sizeof(uint64);
|
||||
break;
|
||||
case FT_STRING:
|
||||
*((char**)(&dataTable[offset])) = NULL; // will replace non-empty or "" strings in AutoProduceStrings
|
||||
offset += sizeof(char*);
|
||||
@@ -288,6 +297,9 @@ char* DBCFileLoader::AutoProduceStrings(const char* format, char* dataTable)
|
||||
case FT_BYTE:
|
||||
offset += sizeof(uint8);
|
||||
break;
|
||||
case FT_LONG:
|
||||
offset += sizeof(uint64);
|
||||
break;
|
||||
case FT_STRING:
|
||||
{
|
||||
// fill only not filled entries
|
||||
|
||||
Reference in New Issue
Block a user