Core: Removed unused functions (leftovers from sd2, was needed when scripts were built as separate dll)

This commit is contained in:
Shauren
2011-04-01 20:31:15 +02:00
parent 2cc51e2482
commit e1bacef346
18 changed files with 29 additions and 96 deletions
@@ -392,7 +392,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
me->setFaction(action.set_faction.factionId);
else
{
if (CreatureInfo const* ci = GetCreatureTemplateStore(me->GetEntry()))
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(me->GetEntry()))
{
//if no id provided, assume reset and then use default
if (me->getFaction() != ci->faction_A)
@@ -408,7 +408,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
//set model based on entry from creature_template
if (action.morph.creatureId)
{
if (CreatureInfo const* ci = GetCreatureTemplateStore(action.morph.creatureId))
if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(action.morph.creatureId))
{
uint32 display_id = sObjectMgr->ChooseDisplayId(0,ci);
me->SetDisplayId(display_id);
@@ -831,7 +831,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
// set model based on entry from creature_template
if (action.mount.creatureId)
{
if (CreatureInfo const* cInfo = GetCreatureTemplateStore(action.mount.creatureId))
if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(action.mount.creatureId))
{
uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo);
me->Mount(display_id);
@@ -234,7 +234,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
else
{
if (CreatureInfo const* ci = GetCreatureTemplateStore((*itr)->ToCreature()->GetEntry()))
if (CreatureInfo const* ci = ObjectMgr::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 = GetCreatureTemplateStore(e.action.morphOrMount.creature))
if (CreatureInfo const* ci = ObjectMgr::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 = GetCreatureTemplateStore(e.action.morphOrMount.creature))
if (CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(e.action.morphOrMount.creature))
{
uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo);
(*itr)->ToUnit()->Mount(display_id);
+2 -38
View File
@@ -5646,7 +5646,7 @@ void ObjectMgr::LoadInstanceEncounters()
{
case ENCOUNTER_CREDIT_KILL_CREATURE:
{
CreatureInfo const* creatureInfo = GetCreatureInfo(creditEntry);
CreatureInfo const* creatureInfo = GetCreatureTemplate(creditEntry);
if (!creatureInfo)
{
sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]);
@@ -8591,7 +8591,7 @@ void ObjectMgr::LoadMailLevelRewards()
continue;
}
if (!GetCreatureTemplateStore(senderEntry))
if (!GetCreatureTemplate(senderEntry))
{
sLog->outErrorDb("Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.",senderEntry,level);
continue;
@@ -9167,12 +9167,6 @@ void ObjectMgr::LoadDbScriptStrings()
sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr);
}
// Functions for scripting access
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
{
return sObjectMgr->GetAreaTriggerScriptId(trigger_id);
}
bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value)
{
// MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values
@@ -9186,36 +9180,6 @@ bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value)
return sObjectMgr->LoadTrinityStrings(table, start_value, end_value);
}
uint32 GetScriptId(const char *name)
{
return sObjectMgr->GetScriptId(name);
}
ObjectMgr::ScriptNameMap & GetScriptNames()
{
return sObjectMgr->GetScriptNames();
}
GameObjectInfo const *GetGameObjectInfo(uint32 id)
{
return ObjectMgr::GetGameObjectInfo(id);
}
CreatureInfo const *GetCreatureInfo(uint32 id)
{
return ObjectMgr::GetCreatureTemplate(id);
}
CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
{
return sCreatureStorage.LookupEntry<CreatureInfo>(entry);
}
Quest const* GetQuestTemplateStore(uint32 entry)
{
return sObjectMgr->GetQuestTemplate(entry);
}
CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass)
{
CreatureBaseStatsMap::const_iterator it = m_creatureBaseStatsMap.find(MAKE_PAIR16(level,unitClass));
+1 -8
View File
@@ -1420,13 +1420,6 @@ class ObjectMgr
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
// scripting access functions
bool LoadTrinityStrings(char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
uint32 GetAreaTriggerScriptId(uint32 trigger_id);
uint32 GetScriptId(const char *name);
ObjectMgr::ScriptNameMap& GetScriptNames();
GameObjectInfo const *GetGameObjectInfo(uint32 id);
CreatureInfo const *GetCreatureInfo(uint32 id);
CreatureInfo const* GetCreatureTemplateStore(uint32 entry);
Quest const* GetQuestTemplateStore(uint32 entry);
bool LoadTrinityStrings(char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
#endif
+1 -1
View File
@@ -853,7 +853,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
ASSERT(player);
ASSERT(trigger);
GET_SCRIPT_RET(AreaTriggerScript, GetAreaTriggerScriptId(trigger->id), tmpscript, false);
GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->id), tmpscript, false);
return tmpscript->OnTrigger(player, trigger);
}
+1 -1
View File
@@ -1007,7 +1007,7 @@ class ScriptMgr
{
// Get an ID for the script. An ID only exists if it's a script that is assigned in the database
// through a script name (or similar).
uint32 id = GetScriptId(script->GetName().c_str());
uint32 id = sObjectMgr->GetScriptId(script->GetName().c_str());
if (id)
{
// Try to find an existing script.
+1 -1
View File
@@ -203,7 +203,7 @@ void SystemMgr::LoadScriptWaypoints()
pTemp.fZ = pFields[4].GetFloat();
pTemp.uiWaitTime = pFields[5].GetUInt32();
CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.uiCreatureEntry);
CreatureInfo const* pCInfo = ObjectMgr::GetCreatureTemplate(pTemp.uiCreatureEntry);
if (!pCInfo)
{