* Remove Player::SetSession (obsolete and dangerous function).

* Speed up map script searches (avoid redundant loops).
* Fix linking errors for ScriptObject::RegisterSelf.

--HG--
branch : trunk
extra : rebase_source : 2ba48fdab4e119c6de7fe64e47c5b8115fdac1b5
This commit is contained in:
XTZGZoReX
2010-08-09 11:07:23 +02:00
parent 4392b95703
commit a038772b3e
3 changed files with 158 additions and 75 deletions

View File

@@ -301,7 +301,7 @@ void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::list<SpellScript *> & s
if (!script)
{
sLog.outError("Spell script %s for spell %u returned a NULL SpellScript pointer!", tmpscript->ToString(), spell_id);
sLog.outError("Spell script %s for spell %u returned a NULL SpellScript pointer!", tmpscript->GetName().c_str(), spell_id);
continue;
}
@@ -324,7 +324,7 @@ void ScriptMgr::CreateSpellScripts(uint32 spell_id, std::vector<std::pair<SpellS
if (!script)
{
sLog.outError("Spell script %s for spell %u returned a NULL SpellScript pointer!", tmpscript->ToString(), spell_id);
sLog.outError("Spell script %s for spell %u returned a NULL SpellScript pointer!", tmpscript->GetName().c_str(), spell_id);
continue;
}
@@ -462,7 +462,7 @@ void ScriptMgr::OnGroupRateCalculation(float& rate, uint32 count, bool isRaid)
{
#define SCR_MAP_END \
break; \
return; \
} \
} \
}
@@ -1188,7 +1188,7 @@ void ScriptMgr::ScriptRegistry<TScript>::AddScript(TScript* const script)
if (it->second == script)
{
sLog.outError("Script '%s' forgot to allocate memory, so this script and/or the script before that can't work.",
script->ToString());
script->GetName().c_str());
return;
}
@@ -1198,7 +1198,7 @@ void ScriptMgr::ScriptRegistry<TScript>::AddScript(TScript* const script)
{
// Get an ID for the script. An ID only exists if it's a script that is assigned in the database
// through a script name (or similar).
uint32 id = GetScriptId(script->ToString());
uint32 id = GetScriptId(script->GetName().c_str());
if (id)
{
// Try to find an existing script.
@@ -1224,7 +1224,7 @@ void ScriptMgr::ScriptRegistry<TScript>::AddScript(TScript* const script)
{
// If the script is already assigned -> delete it!
sLog.outError("Script '%s' already assigned with the same script name, so the script can't work.",
script->ToString());
script->GetName().c_str());
delete script;
}
@@ -1234,7 +1234,7 @@ void ScriptMgr::ScriptRegistry<TScript>::AddScript(TScript* const script)
// The script uses a script name from database, but isn't assigned to anything.
if (script->GetName().find("example") == std::string::npos)
sLog.outErrorDb("Script named '%s' does not have a script name assigned in database.",
script->ToString());
script->GetName().c_str());
delete script;
}