mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 08:00:48 +01:00
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts: src/server/game/AI/EventAI/CreatureEventAI.cpp src/server/game/Globals/ObjectMgr.cpp
This commit is contained in:
@@ -29,10 +29,16 @@
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
#include "GossipDef.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
typedef std::set<ScriptObject*> ExampleScriptContainer;
|
||||
ExampleScriptContainer ExampleScripts;
|
||||
}
|
||||
|
||||
// This is the global static registry of scripts.
|
||||
template<class TScript>
|
||||
class ScriptRegistry
|
||||
@@ -104,6 +110,9 @@ class ScriptRegistry
|
||||
if (script->GetName().find("example") == std::string::npos && script->GetName().find("Smart") == std::string::npos)
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "Script named '%s' does not have a script name assigned in database.",
|
||||
script->GetName().c_str());
|
||||
|
||||
// These scripts don't get stored anywhere so throw them into this to avoid leaking memory
|
||||
ExampleScripts.insert(script);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -160,7 +169,11 @@ class ScriptRegistry
|
||||
if (!V) \
|
||||
return R;
|
||||
|
||||
|
||||
struct TSpellSummary
|
||||
{
|
||||
uint8 Targets; // set of enum SelectTarget
|
||||
uint8 Effects; // set of enum SelectEffect
|
||||
} *SpellSummary;
|
||||
|
||||
ScriptMgr::ScriptMgr()
|
||||
: _scriptCount(0), _scheduledScripts(0)
|
||||
@@ -220,6 +233,13 @@ void ScriptMgr::Unload()
|
||||
SCR_CLEAR(UnitScript);
|
||||
|
||||
#undef SCR_CLEAR
|
||||
|
||||
for (ExampleScriptContainer::iterator itr = ExampleScripts.begin(); itr != ExampleScripts.end(); ++itr)
|
||||
delete *itr;
|
||||
ExampleScripts.clear();
|
||||
|
||||
delete[] SpellSummary;
|
||||
delete[] UnitAI::AISpellInfo;
|
||||
}
|
||||
|
||||
void ScriptMgr::LoadDatabase()
|
||||
@@ -227,14 +247,10 @@ void ScriptMgr::LoadDatabase()
|
||||
sScriptSystemMgr->LoadScriptWaypoints();
|
||||
}
|
||||
|
||||
struct TSpellSummary
|
||||
{
|
||||
uint8 Targets; // set of enum SelectTarget
|
||||
uint8 Effects; // set of enum SelectEffect
|
||||
} *SpellSummary;
|
||||
|
||||
void ScriptMgr::FillSpellSummary()
|
||||
{
|
||||
UnitAI::FillAISpellInfo();
|
||||
|
||||
SpellSummary = new TSpellSummary[sSpellMgr->GetSpellInfoStoreSize()];
|
||||
|
||||
SpellInfo const* pTempSpell;
|
||||
|
||||
Reference in New Issue
Block a user