Core/ObjectMgr: Refactor sCreatureStorage

This commit is contained in:
leak
2011-04-28 22:57:08 +02:00
parent e2e9431ca3
commit c51c817a45
45 changed files with 474 additions and 396 deletions
@@ -128,7 +128,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
{
case SMART_SCRIPT_TYPE_CREATURE:
{
if (!sCreatureStorage.LookupEntry<CreatureInfo>((uint32)temp.entryOrGuid))
if (!sObjectMgr->GetCreatureTemplate((uint32)temp.entryOrGuid))
{
sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: Creature entry (%u) does not exist, skipped loading.", uint32(temp.entryOrGuid));
continue;
@@ -231,7 +231,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder e)
case SMART_TARGET_CREATURE_DISTANCE:
case SMART_TARGET_CREATURE_RANGE:
{
if (e.target.unitDistance.creature && !sCreatureStorage.LookupEntry<CreatureInfo>(e.target.unitDistance.creature))
if (e.target.unitDistance.creature && !sObjectMgr->GetCreatureTemplate(e.target.unitDistance.creature))
{
sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
return false;
@@ -505,7 +505,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL:
if (e.action.morphOrMount.creature || e.action.morphOrMount.model)
{
if (e.action.morphOrMount.creature > 0 && !sCreatureStorage.LookupEntry<CreatureInfo>(e.action.morphOrMount.creature))
if (e.action.morphOrMount.creature > 0 && !sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
{
sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Creature entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
return false;