mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Do not allow base map be accessed from outside if map is instanceable.
This commit is contained in:
@@ -2207,7 +2207,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
|
||||
// If the map is not created, assume it is possible to enter it.
|
||||
// It will be created in the WorldPortAck.
|
||||
Map* map = sMapMgr->FindBaseMap(mapid);
|
||||
Map* map = sMapMgr->FindBaseNonInstanceMap(mapid);
|
||||
if (!map || map->CanEnter(this))
|
||||
{
|
||||
//lets reset near teleport flag if it wasn't reset during chained teleports
|
||||
|
||||
@@ -119,6 +119,14 @@ Map* MapManager::CreateBaseMap(uint32 id)
|
||||
return m;
|
||||
}
|
||||
|
||||
Map* MapManager::FindBaseNonInstanceMap(uint32 mapId) const
|
||||
{
|
||||
Map* map = FindBaseMap(mapId);
|
||||
if(map && map->Instanceable())
|
||||
return NULL;
|
||||
return map;
|
||||
}
|
||||
|
||||
Map* MapManager::CreateMap(uint32 id, Player* player)
|
||||
{
|
||||
Map* m = CreateBaseMap(id);
|
||||
|
||||
@@ -36,11 +36,7 @@ class MapManager
|
||||
|
||||
public:
|
||||
Map* CreateBaseMap(uint32 mapId);
|
||||
Map* FindBaseMap(uint32 mapId) const
|
||||
{
|
||||
MapMapType::const_iterator iter = i_maps.find(mapId);
|
||||
return (iter == i_maps.end() ? NULL : iter->second);
|
||||
}
|
||||
Map* FindBaseNonInstanceMap(uint32 mapId) const;
|
||||
Map* CreateMap(uint32 mapId, Player* player);
|
||||
Map* FindMap(uint32 mapId, uint32 instanceId) const;
|
||||
|
||||
@@ -164,6 +160,12 @@ class MapManager
|
||||
MapManager();
|
||||
~MapManager();
|
||||
|
||||
Map* FindBaseMap(uint32 mapId) const
|
||||
{
|
||||
MapMapType::const_iterator iter = i_maps.find(mapId);
|
||||
return (iter == i_maps.end() ? NULL : iter->second);
|
||||
}
|
||||
|
||||
MapManager(const MapManager &);
|
||||
MapManager& operator=(const MapManager &);
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ void FlightPathMovementGenerator::InitEndGridInfo()
|
||||
void FlightPathMovementGenerator::PreloadEndGrid()
|
||||
{
|
||||
// used to preload the final grid where the flightmaster is
|
||||
Map* endMap = sMapMgr->FindBaseMap(m_endMapId);
|
||||
Map* endMap = sMapMgr->FindBaseNonInstanceMap(m_endMapId);
|
||||
|
||||
// Load the grid
|
||||
if (endMap)
|
||||
|
||||
Reference in New Issue
Block a user