*Fix server startup error from 5184.
--HG-- branch : trunk
This commit is contained in:
@@ -165,13 +165,13 @@ static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, const std::string& f
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename, uint32 customEntriesCount = 0)
|
inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
|
||||||
{
|
{
|
||||||
// compatibility format and C++ structure sizes
|
// compatibility format and C++ structure sizes
|
||||||
assert(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
|
assert(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
|
||||||
|
|
||||||
std::string dbc_filename = dbc_path + filename;
|
std::string dbc_filename = dbc_path + filename;
|
||||||
if(storage.Load(dbc_filename.c_str()), customEntriesCount)
|
if(storage.Load(dbc_filename.c_str()))
|
||||||
{
|
{
|
||||||
bar.step();
|
bar.step();
|
||||||
for(uint8 i = 0; i < MAX_LOCALE; ++i)
|
for(uint8 i = 0; i < MAX_LOCALE; ++i)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ DBCFileLoader::DBCFileLoader()
|
|||||||
fieldsOffset = NULL;
|
fieldsOffset = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DBCFileLoader::Load(const char *filename, const char *fmt, uint32 customEntriesCount)
|
bool DBCFileLoader::Load(const char *filename, const char *fmt)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint32 header;
|
uint32 header;
|
||||||
@@ -55,8 +55,6 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt, uint32 customEnt
|
|||||||
|
|
||||||
EndianConvert(recordCount);
|
EndianConvert(recordCount);
|
||||||
|
|
||||||
recordCount += customEntriesCount;
|
|
||||||
|
|
||||||
if(fread(&fieldCount,4,1,f)!=1) // Number of fields
|
if(fread(&fieldCount,4,1,f)!=1) // Number of fields
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class DBCFileLoader
|
|||||||
DBCFileLoader();
|
DBCFileLoader();
|
||||||
~DBCFileLoader();
|
~DBCFileLoader();
|
||||||
|
|
||||||
bool Load(const char *filename, const char *fmt, uint32 customEntriesCount = 0);
|
bool Load(const char *filename, const char *fmt);
|
||||||
|
|
||||||
class Record
|
class Record
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ class DBCStorage
|
|||||||
char const* GetFormat() const { return fmt; }
|
char const* GetFormat() const { return fmt; }
|
||||||
uint32 GetFieldCount() const { return fieldCount; }
|
uint32 GetFieldCount() const { return fieldCount; }
|
||||||
|
|
||||||
bool Load(char const* fn, uint32 customEntriesCount = 0)
|
bool Load(char const* fn)
|
||||||
{
|
{
|
||||||
DBCFileLoader dbc;
|
DBCFileLoader dbc;
|
||||||
// Check if load was sucessful, only then continue
|
// Check if load was sucessful, only then continue
|
||||||
if(!dbc.Load(fn, fmt, customEntriesCount))
|
if(!dbc.Load(fn, fmt))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
fieldCount = dbc.GetCols();
|
fieldCount = dbc.GetCols();
|
||||||
|
|||||||
Reference in New Issue
Block a user