mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
feat(Core/Instance): Add instance validation for creature scripts (#4596)
This commit is contained in:
@@ -231,25 +231,4 @@ private:
|
||||
uint32 completedEncounters; // completed encounter mask, bit indexes are DungeonEncounter.dbc boss numbers, used for packets
|
||||
};
|
||||
|
||||
template<class AI, class T>
|
||||
AI* GetInstanceAI(T* obj, char const* scriptName)
|
||||
{
|
||||
if (InstanceMap* instance = obj->GetMap()->ToInstanceMap())
|
||||
if (instance->GetInstanceScript())
|
||||
if (instance->GetScriptId() == sObjectMgr->GetScriptId(scriptName))
|
||||
return new AI(obj);
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
template<class AI, class T>
|
||||
AI* GetInstanceAI(T* obj)
|
||||
{
|
||||
if (InstanceMap* instance = obj->GetMap()->ToInstanceMap())
|
||||
if (instance->GetInstanceScript())
|
||||
return new AI(obj);
|
||||
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user