Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Core/Scripting: Allow the use of WorldMapScript for maps that are not…

… continents (aka, all maps)

Closes #171
Signed-off-by: Subv <s.v.h21@hotmail.com>
  • Loading branch information...
commit ba3f25c1435eb763a7eca37d17dcfe9c4d8447e7 1 parent ae0a6cd
@Subv Subv authored
View
1  src/server/game/DataStores/DBCStructure.h
@@ -1292,6 +1292,7 @@ struct MapEntry
bool IsBattleground() const { return map_type == MAP_BATTLEGROUND; }
bool IsBattleArena() const { return map_type == MAP_ARENA; }
bool IsBattlegroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; }
+ bool IsWorldMap() const { return map_type == MAP_COMMON; }
bool GetEntrancePos(int32 &mapid, float &x, float &y) const
{
View
16 src/server/game/Scripting/ScriptMgr.cpp
@@ -582,7 +582,7 @@ void ScriptMgr::OnCreateMap(Map* map)
{
ASSERT(map);
- SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent);
+ SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);
itr->second->OnCreate(map);
SCR_MAP_END;
@@ -599,7 +599,7 @@ void ScriptMgr::OnDestroyMap(Map* map)
{
ASSERT(map);
- SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent);
+ SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);
itr->second->OnDestroy(map);
SCR_MAP_END;
@@ -617,7 +617,7 @@ void ScriptMgr::OnLoadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy)
ASSERT(map);
ASSERT(gmap);
- SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent);
+ SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);
itr->second->OnLoadGridMap(map, gmap, gx, gy);
SCR_MAP_END;
@@ -635,7 +635,7 @@ void ScriptMgr::OnUnloadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy)
ASSERT(map);
ASSERT(gmap);
- SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent);
+ SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);
itr->second->OnUnloadGridMap(map, gmap, gx, gy);
SCR_MAP_END;
@@ -653,7 +653,7 @@ void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player)
ASSERT(map);
ASSERT(player);
- SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent);
+ SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);
itr->second->OnPlayerEnter(map, player);
SCR_MAP_END;
@@ -671,7 +671,7 @@ void ScriptMgr::OnPlayerLeaveMap(Map* map, Player* player)
ASSERT(map);
ASSERT(player);
- SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent);
+ SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);
itr->second->OnPlayerLeave(map, player);
SCR_MAP_END;
@@ -688,7 +688,7 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff)
{
ASSERT(map);
- SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent);
+ SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap);
itr->second->OnUpdate(map, diff);
SCR_MAP_END;
@@ -1415,7 +1415,7 @@ FormulaScript::FormulaScript(const char* name)
WorldMapScript::WorldMapScript(const char* name, uint32 mapId)
: ScriptObject(name), MapScript<Map>(mapId)
{
- if (GetEntry() && !GetEntry()->IsContinent())
+ if (GetEntry() && !GetEntry()->IsWorldMap())
sLog->outError("WorldMapScript for map %u is invalid.", mapId);
ScriptRegistry<WorldMapScript>::AddScript(this);
Please sign in to comment.
Something went wrong with that request. Please try again.