mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 18:13:48 +00:00
feat(Core/Instance): Add instance validation for creature scripts (#4596)
This commit is contained in:
@@ -53,4 +53,12 @@ struct AISpellInfoType
|
||||
|
||||
AISpellInfoType* GetAISpellInfo(uint32 i);
|
||||
|
||||
bool InstanceHasScript(WorldObject const* obj, char const* scriptName);
|
||||
|
||||
template<class AI, class T>
|
||||
inline AI* GetInstanceAI(T* obj, char const* scriptName)
|
||||
{
|
||||
return InstanceHasScript(obj, scriptName) ? new AI(obj) : nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user