[11118] Not report empty world_template as error.

This commit is contained in:
VladimirMangos 2011-02-08 04:29:55 +03:00
parent f73868a703
commit ad29153ee0
4 changed files with 9 additions and 5 deletions

View file

@ -4730,7 +4730,7 @@ struct SQLWorldLoader : public SQLStorageLoaderBase<SQLWorldLoader>
void ObjectMgr::LoadWorldTemplate() void ObjectMgr::LoadWorldTemplate()
{ {
SQLWorldLoader loader; SQLWorldLoader loader;
loader.Load(sWorldTemplate); loader.Load(sWorldTemplate, false);
for(uint32 i = 0; i < sWorldTemplate.MaxEntry; i++) for(uint32 i = 0; i < sWorldTemplate.MaxEntry; i++)
{ {

View file

@ -94,7 +94,7 @@ template <class T>
struct SQLStorageLoaderBase struct SQLStorageLoaderBase
{ {
public: public:
void Load(SQLStorage &storage); void Load(SQLStorage &storage, bool error_at_empty = true);
template<class S, class D> template<class S, class D>
void convert(uint32 field_pos, S src, D &dst); void convert(uint32 field_pos, S src, D &dst);

View file

@ -121,7 +121,7 @@ void SQLStorageLoaderBase<T>::storeValue(char const* value, SQLStorage &store, c
} }
template<class T> template<class T>
void SQLStorageLoaderBase<T>::Load(SQLStorage &store) void SQLStorageLoaderBase<T>::Load(SQLStorage &store, bool error_at_empty /*= true*/)
{ {
uint32 maxi; uint32 maxi;
Field *fields; Field *fields;
@ -150,7 +150,11 @@ void SQLStorageLoaderBase<T>::Load(SQLStorage &store)
if(!result) if(!result)
{ {
if (error_at_empty)
sLog.outError("%s table is empty!\n", store.table); sLog.outError("%s table is empty!\n", store.table);
else
sLog.outString("%s table is empty!\n", store.table);
store.RecordCount = 0; store.RecordCount = 0;
return; return;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11117" #define REVISION_NR "11118"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__