From 8ecd5c62545e35b18da040a2ad84ed1ddd7792ed Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Thu, 28 Sep 2017 23:50:42 +0300 Subject: [PATCH] Try fix crash - upon reload you must respawn creatures to make AI apply --- LuaEngine.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/LuaEngine.cpp b/LuaEngine.cpp index cc529f2..7dd4e3e 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -119,22 +119,6 @@ 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& creatureMap) - { - for (auto const& p : creatureMap) - if (p.second->IsInWorld()) - p.second->AIM_Initialize(); - } - - template - void Visit(std::unordered_map&) { } -}; -#endif - void Eluna::_ReloadEluna() { LOCK_ELUNA; @@ -157,16 +141,6 @@ void Eluna::_ReloadEluna() // Run scripts from laoded paths sEluna->RunScripts(); -#ifdef TRINITY - // Re initialize creature AI restoring C++ AI or applying lua AI - sMapMgr->DoForAllMaps([](Map* map) - { - ElunaAIUpdateWorker worker; - TypeContainerVisitor visitor(worker); - visitor.Visit(map->GetObjectsStore()); - }); -#endif - reload = false; }