aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/SmartScripts
diff options
context:
space:
mode:
authorleak <leakzx@googlemail.com>2011-04-28 22:57:08 +0200
committerleak <leakzx@googlemail.com>2011-04-28 22:57:08 +0200
commitc51c817a4510dd193f79e03ac21de51f43f0a33e (patch)
tree5afc313478460ab84cf1214c27ec109f7b53babe /src/server/game/AI/SmartScripts
parente2e9431ca3b4725f29e13350eb9ca0b46cc0aff1 (diff)
Core/ObjectMgr: Refactor sCreatureStorage
Diffstat (limited to 'src/server/game/AI/SmartScripts')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp6
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp6
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index f08be714ea8..dee4b4c2c71 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -234,7 +234,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
else
{
- if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate((*itr)->ToCreature()->GetEntry()))
+ if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*itr)->ToCreature()->GetEntry()))
{
if ((*itr)->ToCreature()->getFaction() != ci->faction_A)
{
@@ -266,7 +266,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
//set model based on entry from creature_template
if (e.action.morphOrMount.creature)
{
- if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(e.action.morphOrMount.creature))
+ if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
{
uint32 display_id = sObjectMgr->ChooseDisplayId(0, ci);
(*itr)->ToCreature()->SetDisplayId(display_id);
@@ -940,7 +940,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (e.action.morphOrMount.creature > 0)
{
- if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(e.action.morphOrMount.creature))
+ if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
{
uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo);
(*itr)->ToUnit()->Mount(display_id);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index cdd07afad52..fe6db0bf6d1 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -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;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index c686d0bc51d..bbd38df61d6 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -1264,7 +1264,7 @@ class SmartAIMgr
}
inline bool IsCreatureValid(SmartScriptHolder e, uint32 entry)
{
- if (!sCreatureStorage.LookupEntry<CreatureInfo>(entry))
+ if (!sObjectMgr->GetCreatureTemplate(entry))
{
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(), entry);
return false;