aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Database/DBCFileLoader.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-08-27 17:44:30 +0200
committerQAston <none@none>2009-08-27 17:44:30 +0200
commit6b703d600bd08fa642a2e121fb53d5749d677076 (patch)
treefb9841c1ce09e9f83542c84340f97ded510db85a /src/shared/Database/DBCFileLoader.cpp
parent562b4fc0a4cc748df4a5732771a8b83b8af093c1 (diff)
*Add `spell_dbc` table to store dbc entries not present in client
*Remove workaround from Demonic Circle code and use the sql table instead. --HG-- branch : trunk
Diffstat (limited to 'src/shared/Database/DBCFileLoader.cpp')
-rw-r--r--src/shared/Database/DBCFileLoader.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/shared/Database/DBCFileLoader.cpp b/src/shared/Database/DBCFileLoader.cpp
index 23f602f5c93..e7ebeedecfb 100644
--- a/src/shared/Database/DBCFileLoader.cpp
+++ b/src/shared/Database/DBCFileLoader.cpp
@@ -137,7 +137,7 @@ uint32 DBCFileLoader::GetFormatRecordSize(const char * format,int32* index_pos)
return recordsize;
}
-char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable)
+char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable, uint32 sqlRecordCount, uint32 sqlHighestIndex, char *& sqlDataTable)
{
/*
format STRING, NA, FLOAT,NA,INT <=>
@@ -168,6 +168,10 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
if(ind>maxi)maxi=ind;
}
+ // If higher index avalible from sql - use it instead of dbcs
+ if (sqlHighestIndex > maxi)
+ maxi = sqlHighestIndex;
+
++maxi;
records=maxi;
indexTable=new ptr[maxi];
@@ -175,15 +179,15 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
}
else
{
- records = recordCount;
- indexTable = new ptr[recordCount];
+ records = recordCount + sqlRecordCount;
+ indexTable = new ptr[recordCount+ sqlRecordCount];
}
- char* dataTable= new char[recordCount*recordsize];
+ char* dataTable= new char[(recordCount + sqlRecordCount)*recordsize];
uint32 offset=0;
- for(uint32 y =0;y<recordCount;y++)
+ for(uint32 y =0;y<recordCount;++y)
{
if(i>=0)
{
@@ -216,6 +220,7 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
}
}
}
+ sqlDataTable = dataTable + offset;
return dataTable;
}