diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-05-12 18:49:51 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2017-05-12 18:50:27 +0200 |
commit | 7e538980a2b4fc6c74bde7bd456633d954272708 (patch) | |
tree | 73454d83035b0ddd099e4bc934222df60b66f597 /src/server/game/Scripting/ScriptMgr.cpp | |
parent | 8fdf0778ca340d0bbf0e70dbf091d20c838981d3 (diff) |
Core/Database: Include cleanup
Diffstat (limited to 'src/server/game/Scripting/ScriptMgr.cpp')
-rw-r--r-- | src/server/game/Scripting/ScriptMgr.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 9f912d95177..8b9312c84f2 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -2471,8 +2471,11 @@ UnitScript::UnitScript(const char* name, bool addToScripts) } WorldMapScript::WorldMapScript(const char* name, uint32 mapId) - : ScriptObject(name), MapScript<Map>(mapId) + : ScriptObject(name), MapScript<Map>(sMapStore.LookupEntry(mapId)) { + if (!GetEntry()) + TC_LOG_ERROR("scripts", "Invalid WorldMapScript for %u; no such map ID.", mapId); + if (GetEntry() && !GetEntry()->IsWorldMap()) TC_LOG_ERROR("scripts", "WorldMapScript for map %u is invalid.", mapId); @@ -2480,8 +2483,11 @@ WorldMapScript::WorldMapScript(const char* name, uint32 mapId) } InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId) - : ScriptObject(name), MapScript<InstanceMap>(mapId) + : ScriptObject(name), MapScript<InstanceMap>(sMapStore.LookupEntry(mapId)) { + if (!GetEntry()) + TC_LOG_ERROR("scripts", "Invalid InstanceMapScript for %u; no such map ID.", mapId); + if (GetEntry() && !GetEntry()->IsDungeon()) TC_LOG_ERROR("scripts", "InstanceMapScript for map %u is invalid.", mapId); @@ -2489,8 +2495,11 @@ InstanceMapScript::InstanceMapScript(const char* name, uint32 mapId) } BattlegroundMapScript::BattlegroundMapScript(const char* name, uint32 mapId) - : ScriptObject(name), MapScript<BattlegroundMap>(mapId) + : ScriptObject(name), MapScript<BattlegroundMap>(sMapStore.LookupEntry(mapId)) { + if (!GetEntry()) + TC_LOG_ERROR("scripts", "Invalid BattlegroundMapScript for %u; no such map ID.", mapId); + if (GetEntry() && !GetEntry()->IsBattleground()) TC_LOG_ERROR("scripts", "BattlegroundMapScript for map %u is invalid.", mapId); |