[12055] Add some defines for hard-coded field-indexes that need special convertion on SQL-Storage loading - Idea by Vladimir

This commit is contained in:
Schmoozerd 2012-07-18 13:48:51 +02:00
parent 754634fe42
commit 1c7e46a4a8
3 changed files with 8 additions and 3 deletions

View file

@ -1718,6 +1718,11 @@ struct SpellEntry
bool IsFitToFamilyMask(SpellFamily family, T t) const;
};
// A few fields which are required for automated convertion
// NOTE that these fields are count by _skipping_ the fields that are unused!
#define LOADED_SPELLDBC_FIELD_POS_EQUIPPED_ITEM_CLASS 65 // Must be converted to -1
#define LOADED_SPELLDBC_FIELD_POS_SPELLNAME_0 132 // Links to "MaNGOS server-side spell"
struct SpellCastTimesEntry
{
uint32 ID; // 0 m_ID

View file

@ -6776,7 +6776,7 @@ struct SQLSpellLoader : public SQLStorageLoaderBase<SQLSpellLoader>
template<class S, class D>
void default_fill(uint32 field_pos, S src, D &dst)
{
if (field_pos == 65) // EquippedItemClass
if (field_pos == LOADED_SPELLDBC_FIELD_POS_EQUIPPED_ITEM_CLASS)
dst = D(-1);
else
dst = D(src);
@ -6784,7 +6784,7 @@ struct SQLSpellLoader : public SQLStorageLoaderBase<SQLSpellLoader>
void default_fill_to_str(uint32 field_pos, char const* /*src*/, char * & dst)
{
if (field_pos == 132) // SpellName[0]
if (field_pos == LOADED_SPELLDBC_FIELD_POS_SPELLNAME_0)
{
dst = SERVER_SIDE_SPELL;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12054"
#define REVISION_NR "12055"
#endif // __REVISION_NR_H__