aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 9c37f9a6bee..cbcf52789bb 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -1703,11 +1703,11 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing
if(!GetSession()->PlayerLogout())
{
- WorldLocation oldLoc;
- GetPosition(oldLoc);
+ Position oldPos;
+ GetPosition(oldPos);
Relocate(x, y, z, orientation);
SendTeleportAckMsg();
- Relocate(oldLoc);
+ Relocate(oldPos);
}
}
else
@@ -2124,7 +2124,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)
@@ -5747,7 +5747,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;
@@ -14457,7 +14457,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);
}
}
@@ -14604,7 +14606,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();
@@ -15929,10 +15931,10 @@ void Player::SaveToDB()
ss << GetTeleportDest().mapid << ", "
<< (uint32)0 << ", "
<< (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;
@@ -16007,10 +16009,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() );