From 5299225a8bb052e808fc749ff65d7208da54c866 Mon Sep 17 00:00:00 2001 From: megamage Date: Mon, 2 Feb 2009 09:53:01 -0600 Subject: [7220] Check creature spells data at server startup. Author: VladimirMangos --HG-- branch : trunk --- src/game/ObjectMgr.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/game/ObjectMgr.cpp') diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 9203436f527..c4cdc057815 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -869,6 +869,15 @@ void ObjectMgr::LoadCreatureTemplates() 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(cInfo)->spells[i] = 0; + } + } + 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); -- cgit v1.2.3