diff options
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/Database/DBCFileLoader.cpp | 4 | ||||
| -rw-r--r-- | src/shared/Database/DBCFileLoader.h | 2 | ||||
| -rw-r--r-- | src/shared/Database/DBCStore.h | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/shared/Database/DBCFileLoader.cpp b/src/shared/Database/DBCFileLoader.cpp index 23f602f5c93..dc968fbce3b 100644 --- a/src/shared/Database/DBCFileLoader.cpp +++ b/src/shared/Database/DBCFileLoader.cpp @@ -30,7 +30,7 @@ DBCFileLoader::DBCFileLoader() fieldsOffset = NULL; } -bool DBCFileLoader::Load(const char *filename, const char *fmt) +bool DBCFileLoader::Load(const char *filename, const char *fmt, uint32 customEntriesCount) { uint32 header; @@ -55,6 +55,8 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt) EndianConvert(recordCount); + recordCount += customEntriesCount; + if(fread(&fieldCount,4,1,f)!=1) // Number of fields return false; diff --git a/src/shared/Database/DBCFileLoader.h b/src/shared/Database/DBCFileLoader.h index 13562148dfc..ebdfef4523c 100644 --- a/src/shared/Database/DBCFileLoader.h +++ b/src/shared/Database/DBCFileLoader.h @@ -41,7 +41,7 @@ class DBCFileLoader DBCFileLoader(); ~DBCFileLoader(); - bool Load(const char *filename, const char *fmt); + bool Load(const char *filename, const char *fmt, uint32 customEntriesCount = 0); class Record { diff --git a/src/shared/Database/DBCStore.h b/src/shared/Database/DBCStore.h index 523d5c5a0b3..2906a93edbc 100644 --- a/src/shared/Database/DBCStore.h +++ b/src/shared/Database/DBCStore.h @@ -34,11 +34,11 @@ class DBCStorage char const* GetFormat() const { return fmt; } uint32 GetFieldCount() const { return fieldCount; } - bool Load(char const* fn) + bool Load(char const* fn, uint32 customEntriesCount = 0) { DBCFileLoader dbc; // Check if load was sucessful, only then continue - if(!dbc.Load(fn, fmt)) + if(!dbc.Load(fn, fmt, customEntriesCount)) return false; fieldCount = dbc.GetCols(); |
