diff options
author | XTZGZoReX <none@none> | 2010-08-09 11:07:23 +0200 |
---|---|---|
committer | XTZGZoReX <none@none> | 2010-08-09 11:07:23 +0200 |
commit | a038772b3e7e5b3b88b8064448eeaa7e0cc2c4ea (patch) | |
tree | 59544a6986d36c28cd4855eec2469831939cb2e4 /src/server/game/Scripting/ScriptMgr.cpp | |
parent | 4392b95703d0408eac1b24b6faf3c90c4d75982a (diff) |
* 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
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.cpp')
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index d2277f3a07a..3f16c503e20 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -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; } |