[7220] Check creature spells data at server startup. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -360,10 +360,8 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
|||||||
SetPvP(true);
|
SetPvP(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_spells[0] = GetCreatureInfo()->spell1;
|
for(int i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||||
m_spells[1] = GetCreatureInfo()->spell2;
|
m_spells[i] = GetCreatureInfo()->spells[i];
|
||||||
m_spells[2] = GetCreatureInfo()->spell3;
|
|
||||||
m_spells[3] = GetCreatureInfo()->spell4;
|
|
||||||
|
|
||||||
// HACK: trigger creature is always not selectable
|
// HACK: trigger creature is always not selectable
|
||||||
if(isTrigger())
|
if(isTrigger())
|
||||||
|
|||||||
+1
-4
@@ -195,10 +195,7 @@ struct CreatureInfo
|
|||||||
int32 resistance4;
|
int32 resistance4;
|
||||||
int32 resistance5;
|
int32 resistance5;
|
||||||
int32 resistance6;
|
int32 resistance6;
|
||||||
uint32 spell1;
|
uint32 spells[CREATURE_MAX_SPELLS];
|
||||||
uint32 spell2;
|
|
||||||
uint32 spell3;
|
|
||||||
uint32 spell4;
|
|
||||||
uint32 PetSpellDataId;
|
uint32 PetSpellDataId;
|
||||||
uint32 mingold;
|
uint32 mingold;
|
||||||
uint32 maxgold;
|
uint32 maxgold;
|
||||||
|
|||||||
@@ -869,6 +869,15 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u)", cInfo->Entry, cInfo->PetSpellDataId);
|
sLog.outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u)", cInfo->Entry, cInfo->PetSpellDataId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||||
|
{
|
||||||
|
if(cInfo->spells[i] && !sSpellStore.LookupEntry(cInfo->spells[i]))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Creature (Entry: %u) has non-existing Spell%d (%u), set to 0", cInfo->Entry, i+1,cInfo->spells[i]);
|
||||||
|
const_cast<CreatureInfo*>(cInfo)->spells[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(cInfo->MovementType >= MAX_DB_MOTION_TYPE)
|
if(cInfo->MovementType >= MAX_DB_MOTION_TYPE)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignore and set to IDLE.",cInfo->Entry,cInfo->MovementType);
|
sLog.outErrorDb("Creature (Entry: %u) has wrong movement generator type (%u), ignore and set to IDLE.",cInfo->Entry,cInfo->MovementType);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7219"
|
#define REVISION_NR "7220"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|||||||
Reference in New Issue
Block a user