mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8026] Obtain object's map directly by calling appropriate WorldObject::GetMap()/GetBaseMap() functions instead of accessing MapManager. Code cleanups. Big thanks Infinity for tests.
Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
parent
1187c8698c
commit
b76c4c2f3c
29 changed files with 99 additions and 99 deletions
|
|
@ -2042,7 +2042,7 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes
|
|||
bool Player::IsUnderWater() const
|
||||
{
|
||||
return IsInWater() &&
|
||||
GetPositionZ() < (MapManager::Instance().GetBaseMap(GetMapId())->GetWaterLevel(GetPositionX(),GetPositionY())-2);
|
||||
GetPositionZ() < (GetBaseMap()->GetWaterLevel(GetPositionX(),GetPositionY())-2);
|
||||
}
|
||||
|
||||
void Player::SetInWater(bool apply)
|
||||
|
|
@ -5623,7 +5623,7 @@ void Player::CheckExploreSystem()
|
|||
if (isInFlight())
|
||||
return;
|
||||
|
||||
uint16 areaFlag=MapManager::Instance().GetBaseMap(GetMapId())->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ());
|
||||
uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ());
|
||||
if(areaFlag==0xffff)
|
||||
return;
|
||||
int offset = areaFlag / 32;
|
||||
|
|
@ -14061,7 +14061,9 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
}
|
||||
else
|
||||
{
|
||||
Relocate(GetBattleGroundEntryPoint());
|
||||
const WorldLocation& _loc = GetBattleGroundEntryPoint();
|
||||
SetMapId(_loc.mapid);
|
||||
Relocate(_loc.coord_x, _loc.coord_y, _loc.coord_z, _loc.orientation);
|
||||
//RemoveArenaAuras(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -14173,7 +14175,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
if(at)
|
||||
Relocate(at->target_X, at->target_Y, at->target_Z, at->target_Orientation);
|
||||
else
|
||||
sLog.outError("Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no aretrigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), GetMapId());
|
||||
sLog.outError("Player %s(GUID: %u) logged in to a reset instance (map: %u) and there is no area-trigger leading to this map. Thus he can't be ported back to the entrance. This _might_ be an exploit attempt.", GetName(), GetGUIDLow(), GetMapId());
|
||||
}
|
||||
|
||||
SaveRecallPosition();
|
||||
|
|
@ -15428,10 +15430,10 @@ void Player::SaveToDB()
|
|||
{
|
||||
ss << GetTeleportDest().mapid << ", "
|
||||
<< (uint32)GetDifficulty() << ", "
|
||||
<< finiteAlways(GetTeleportDest().x) << ", "
|
||||
<< finiteAlways(GetTeleportDest().y) << ", "
|
||||
<< finiteAlways(GetTeleportDest().z) << ", "
|
||||
<< finiteAlways(GetTeleportDest().o) << ", '";
|
||||
<< finiteAlways(GetTeleportDest().coord_x) << ", "
|
||||
<< finiteAlways(GetTeleportDest().coord_y) << ", "
|
||||
<< finiteAlways(GetTeleportDest().coord_z) << ", "
|
||||
<< finiteAlways(GetTeleportDest().orientation) << ", '";
|
||||
}
|
||||
|
||||
uint16 i;
|
||||
|
|
@ -15503,10 +15505,10 @@ void Player::SaveToDB()
|
|||
ss << GetBGTeam();
|
||||
ss << ", ";
|
||||
ss << m_bgEntryPoint.mapid << ", "
|
||||
<< finiteAlways(m_bgEntryPoint.x) << ", "
|
||||
<< finiteAlways(m_bgEntryPoint.y) << ", "
|
||||
<< finiteAlways(m_bgEntryPoint.z) << ", "
|
||||
<< finiteAlways(m_bgEntryPoint.o);
|
||||
<< finiteAlways(m_bgEntryPoint.coord_x) << ", "
|
||||
<< finiteAlways(m_bgEntryPoint.coord_y) << ", "
|
||||
<< finiteAlways(m_bgEntryPoint.coord_z) << ", "
|
||||
<< finiteAlways(m_bgEntryPoint.orientation);
|
||||
ss << ")";
|
||||
|
||||
CharacterDatabase.Execute( ss.str().c_str() );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue