Permalink
Browse files

Remove unnecessary const_cast<Map*>.

  • Loading branch information...
1 parent 98be413 commit 5a0ffefecc23886ae7bc4d3c2c2137b2515eba90 megamage committed Nov 23, 2011
@@ -1170,7 +1170,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
sObjectMgr->AddCreatureToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
- Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid));
+ Map* map = sMapMgr->CreateBaseMap(data->mapid);
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{
@@ -1199,7 +1199,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
sObjectMgr->AddGameobjectToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed
- Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid));
+ Map* map = sMapMgr->CreateBaseMap(data->mapid);
// We use current coords to unspawn, not spawn coords since creature can have changed grid
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{
@@ -1599,7 +1599,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
if (!goinfo)
return 0;
- Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId));
+ Map* map = sMapMgr->CreateBaseMap(mapId);
if (!map)
return 0;
@@ -1660,7 +1660,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos)
AddCreatureToGrid(guid, &data);
// Spawn if necessary (loaded grids only)
- if (Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId)))
+ if (Map* map = sMapMgr->CreateBaseMap(mapId))
{
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsGridLoaded(data.posX, data.posY))
@@ -1713,7 +1713,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
AddCreatureToGrid(guid, &data);
// Spawn if necessary (loaded grids only)
- if (Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId)))
+ if (Map* map = sMapMgr->CreateBaseMap(mapId))
{
// We use spawn coords to spawn
if (!map->Instanceable() && !map->IsRemovalGrid(x, y))
@@ -511,7 +511,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr)
void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
{
sLog->outDebug(LOG_FILTER_MAPS, "InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);
- Map* map = (MapInstanced*)sMapMgr->CreateBaseMap(mapid);
+ Map const* map = sMapMgr->CreateBaseMap(mapid);
if (!map->Instanceable())
return;
@@ -359,7 +359,7 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
sObjectMgr->AddCreatureToGrid(obj->guid, data);
// Spawn if necessary (loaded grids only)
- Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid));
+ Map* map = sMapMgr->CreateBaseMap(data->mapid);
// We use spawn coords to spawn
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{
@@ -385,7 +385,7 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj)
sObjectMgr->AddGameobjectToGrid(obj->guid, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed
- Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(data->mapid));
+ Map* map = sMapMgr->CreateBaseMap(data->mapid);
// We use current coords to unspawn, not spawn coords since creature can have changed grid
if (!map->Instanceable() && map->IsGridLoaded(data->posX, data->posY))
{

0 comments on commit 5a0ffef

Please sign in to comment.