Clean up very some confusing MapManager functions (create/find map/base map).
This commit is contained in:
@@ -940,7 +940,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
|
||||
return false;
|
||||
}
|
||||
|
||||
SetMap(sMapMgr->CreateMap(info->mapId, this, 0));
|
||||
SetMap(sMapMgr->CreateMap(info->mapId, this));
|
||||
|
||||
uint8 powertype = cEntry->powerType;
|
||||
|
||||
@@ -2205,7 +2205,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
if (!sMapMgr->CanPlayerEnter(mapid, this, false))
|
||||
return false;
|
||||
|
||||
Map* map = sMapMgr->CreateMap(mapid, this, 0);
|
||||
Map* map = sMapMgr->CreateMap(mapid, this);
|
||||
if (!map || map->CanEnter(this))
|
||||
{
|
||||
//lets reset near teleport flag if it wasn't reset during chained teleports
|
||||
@@ -16790,7 +16790,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
|
||||
// NOW player must have valid map
|
||||
// load the player's map here if it's not already loaded
|
||||
Map* map = sMapMgr->CreateMap(mapId, this, instanceId);
|
||||
Map* map = sMapMgr->CreateMap(mapId, this);
|
||||
|
||||
if (!map)
|
||||
{
|
||||
@@ -16808,14 +16808,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
||||
RelocateToHomebind();
|
||||
}
|
||||
|
||||
map = sMapMgr->CreateMap(mapId, this, 0);
|
||||
map = sMapMgr->CreateMap(mapId, this);
|
||||
if (!map)
|
||||
{
|
||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
|
||||
mapId = info->mapId;
|
||||
Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
|
||||
sLog->outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||
map = sMapMgr->CreateMap(mapId, this, 0);
|
||||
map = sMapMgr->CreateMap(mapId, this);
|
||||
if (!map)
|
||||
{
|
||||
sLog->outError("Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||
|
||||
Reference in New Issue
Block a user