*Update movement enums - thanks to Zor for info.
*Add functions for position data streaming. --HG-- branch : trunk
This commit is contained in:
1 parent
850868c8a3
commit
6353e7dd8c
60 files changed
+428
-366
No files matched your search
@@ -1851,10 +1851,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
{
|
||||
m_transport->RemovePassenger(this);
|
||||
m_transport = NULL;
|
||||
m_movementInfo.t_x = 0.0f;
|
||||
m_movementInfo.t_y = 0.0f;
|
||||
m_movementInfo.t_z = 0.0f;
|
||||
m_movementInfo.t_o = 0.0f;
|
||||
m_movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
m_movementInfo.t_time = 0;
|
||||
m_movementInfo.t_seat = -1;
|
||||
}
|
||||
@@ -1990,7 +1987,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
|
||||
data.Initialize(SMSG_NEW_WORLD, (20));
|
||||
if (m_transport)
|
||||
data << (uint32)mapid << m_movementInfo.t_x << m_movementInfo.t_y << m_movementInfo.t_z << m_movementInfo.t_o;
|
||||
data << (uint32)mapid << m_movementInfo.t_pos.PositionXYZOStream();
|
||||
else
|
||||
data << (uint32)mapid << (float)x << (float)y << (float)z << (float)orientation;
|
||||
|
||||
@@ -2010,10 +2007,10 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
|
||||
if (m_transport)
|
||||
{
|
||||
final_x += m_movementInfo.t_x;
|
||||
final_y += m_movementInfo.t_y;
|
||||
final_z += m_movementInfo.t_z;
|
||||
final_o += m_movementInfo.t_o;
|
||||
final_x += m_movementInfo.t_pos.GetPositionX();
|
||||
final_y += m_movementInfo.t_pos.GetPositionY();
|
||||
final_z += m_movementInfo.t_pos.GetPositionZ();
|
||||
final_o += m_movementInfo.t_pos.GetOrientation();
|
||||
}
|
||||
|
||||
m_teleport_dest = WorldLocation(mapid, final_x, final_y, final_z, final_o);
|
||||
@@ -16057,20 +16054,17 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder)
|
||||
instanceId = 0;
|
||||
|
||||
m_movementInfo.t_guid = MAKE_NEW_GUID(transGUID, 0, HIGHGUID_TRANSPORT);
|
||||
m_movementInfo.t_x = fields[26].GetFloat();
|
||||
m_movementInfo.t_y = fields[27].GetFloat();
|
||||
m_movementInfo.t_z = fields[28].GetFloat();
|
||||
m_movementInfo.t_o = fields[29].GetFloat();
|
||||
m_movementInfo.t_pos.Relocate(fields[26].GetFloat(), fields[27].GetFloat(), fields[28].GetFloat(), fields[29].GetFloat());
|
||||
|
||||
if (!Trinity::IsValidMapCoord(
|
||||
GetPositionX()+m_movementInfo.t_x,GetPositionY()+m_movementInfo.t_y,
|
||||
GetPositionZ()+m_movementInfo.t_z,GetOrientation()+m_movementInfo.t_o) ||
|
||||
GetPositionX()+m_movementInfo.t_pos.m_positionX,GetPositionY()+m_movementInfo.t_pos.m_positionY,
|
||||
GetPositionZ()+m_movementInfo.t_pos.m_positionZ,GetOrientation()+m_movementInfo.t_pos.m_orientation) ||
|
||||
// transport size limited
|
||||
m_movementInfo.t_x > 250 || m_movementInfo.t_y > 250 || m_movementInfo.t_z > 250)
|
||||
m_movementInfo.t_pos.m_positionX > 250 || m_movementInfo.t_pos.m_positionY > 250 || m_movementInfo.t_pos.m_positionZ > 250)
|
||||
{
|
||||
sLog.outError("Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",
|
||||
guid,GetPositionX()+m_movementInfo.t_x,GetPositionY()+m_movementInfo.t_y,
|
||||
GetPositionZ()+m_movementInfo.t_z,GetOrientation()+m_movementInfo.t_o);
|
||||
guid,GetPositionX()+m_movementInfo.t_pos.m_positionX,GetPositionY()+m_movementInfo.t_pos.m_positionY,
|
||||
GetPositionZ()+m_movementInfo.t_pos.m_positionZ,GetOrientation()+m_movementInfo.t_pos.m_orientation);
|
||||
|
||||
RelocateToHomebind();
|
||||
}
|
||||
@@ -17675,10 +17669,10 @@ void Player::SaveToDB()
|
||||
ss << m_resetTalentsCost << ", ";
|
||||
ss << (uint64)m_resetTalentsTime << ", ";
|
||||
|
||||
ss << finiteAlways(m_movementInfo.t_x) << ", ";
|
||||
ss << finiteAlways(m_movementInfo.t_y) << ", ";
|
||||
ss << finiteAlways(m_movementInfo.t_z) << ", ";
|
||||
ss << finiteAlways(m_movementInfo.t_o) << ", ";
|
||||
ss << finiteAlways(m_movementInfo.t_pos.GetPositionX()) << ", ";
|
||||
ss << finiteAlways(m_movementInfo.t_pos.GetPositionY()) << ", ";
|
||||
ss << finiteAlways(m_movementInfo.t_pos.GetPositionZ()) << ", ";
|
||||
ss << finiteAlways(m_movementInfo.t_pos.GetOrientation()) << ", ";
|
||||
if (m_transport)
|
||||
ss << m_transport->GetGUIDLow();
|
||||
else
|
||||
@@ -22845,7 +22839,7 @@ uint8 Player::CanEquipUniqueItem(ItemPrototype const* itemProto, uint8 except_sl
|
||||
void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
{
|
||||
// calculate total z distance of the fall
|
||||
float z_diff = m_lastFallZ - movementInfo.z;
|
||||
float z_diff = m_lastFallZ - movementInfo.pos.GetPositionZ();
|
||||
//sLog.outDebug("zDiff = %f", z_diff);
|
||||
|
||||
//Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
|
||||
@@ -22863,8 +22857,8 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
{
|
||||
uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld.getRate(RATE_DAMAGE_FALL));
|
||||
|
||||
float height = movementInfo.z;
|
||||
UpdateGroundPositionZ(movementInfo.x,movementInfo.y,height);
|
||||
float height = movementInfo.t_pos.m_positionZ;
|
||||
UpdateGroundPositionZ(movementInfo.pos.m_positionX,movementInfo.pos.m_positionY,height);
|
||||
|
||||
if (damage > 0)
|
||||
{
|
||||
@@ -22885,7 +22879,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
|
||||
}
|
||||
|
||||
//Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction
|
||||
DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.z, height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
|
||||
DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall);
|
||||
}
|
||||
}
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LANDING); // No fly zone - Parachute
|
||||
@@ -23165,8 +23159,8 @@ void Player::UpdateKnownCurrencies(uint32 itemId, bool apply)
|
||||
|
||||
void Player::UpdateFallInformationIfNeed(MovementInfo const& minfo,uint16 opcode)
|
||||
{
|
||||
if (m_lastFallTime >= minfo.fallTime || m_lastFallZ <= minfo.z || opcode == MSG_MOVE_FALL_LAND)
|
||||
SetFallInformation(minfo.fallTime, minfo.z);
|
||||
if (m_lastFallTime >= minfo.fallTime || m_lastFallZ <= minfo.pos.GetPositionZ() || opcode == MSG_MOVE_FALL_LAND)
|
||||
SetFallInformation(minfo.fallTime, minfo.pos.GetPositionZ());
|
||||
}
|
||||
|
||||
void Player::UnsummonPetTemporaryIfAny()
|
||||
|
||||
Reference in new issue
Block a user