mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Fix TC build
This commit is contained in:
@@ -101,6 +101,22 @@ void Eluna::LoadScriptPaths()
|
||||
ELUNA_LOG_DEBUG("[Eluna]: Loaded %u scripts in %u ms", uint32(lua_scripts.size() + lua_extensions.size()), ElunaUtil::GetTimeDiff(oldMSTime));
|
||||
}
|
||||
|
||||
#ifdef TRINITY
|
||||
class ElunaAIUpdateWorker
|
||||
{
|
||||
public:
|
||||
void Visit(std::unordered_map<ObjectGuid, Creature*>& creatureMap)
|
||||
{
|
||||
for (auto const& p : creatureMap)
|
||||
if (p.second->IsInWorld())
|
||||
p.second->AIM_Initialize();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void Visit(std::unordered_map<ObjectGuid, T*>&) { }
|
||||
};
|
||||
#endif
|
||||
|
||||
void Eluna::_ReloadEluna()
|
||||
{
|
||||
LOCK_ELUNA;
|
||||
@@ -125,12 +141,12 @@ void Eluna::_ReloadEluna()
|
||||
|
||||
#ifdef TRINITY
|
||||
// Re initialize creature AI restoring C++ AI or applying lua AI
|
||||
sMapMgr->DoForAllMaps([](Map* map)
|
||||
{
|
||||
HashMapHolder<Creature>::MapType const m = ObjectAccessor::GetCreatures();
|
||||
for (HashMapHolder<Creature>::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->second->IsInWorld())
|
||||
iter->second->AIM_Initialize();
|
||||
}
|
||||
ElunaAIUpdateWorker worker;
|
||||
TypeContainerVisitor<ElunaAIUpdateWorker, MapStoredObjectTypesContainer> visitor(worker);
|
||||
visitor.Visit(map->GetObjectsStore());
|
||||
});
|
||||
#endif
|
||||
|
||||
reload = false;
|
||||
|
||||
Reference in New Issue
Block a user