Added some missing SetFallInformation calls

Fixed HP drop bug on zeppelins
Fixed possible packet relocation problems on huge transports
This commit is contained in:
Aokromes committed 2017-02-17 09:39:09 +01:00
1 parent 00622f0ad9
commit 0748e7f820
5 files changed
+28 -4

No files matched your search

+2 -2
View File
@@ -1931,7 +1931,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// this will be used instead of the current location in SaveToDB
m_teleport_dest = WorldLocation(mapid, x, y, z, orientation);
SetFallInformation(0, z);
SetFallInformation(0, GetPositionZ());
// code for finish transfer called in WorldSession::HandleMovementOpcodes()
// at client packet CMSG_MOVE_TELEPORT_ACK
@@ -2044,7 +2044,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
oldmap->RemovePlayerFromMap(this, false);
m_teleport_dest = WorldLocation(mapid, x, y, z, orientation);
SetFallInformation(0, z);
SetFallInformation(0, GetPositionZ());
// if the player is saved before worldportack (at logout for example)
// this will be used instead of the current location in SaveToDB
@@ -284,7 +284,10 @@ void Transport::RemovePassenger(WorldObject* passenger)
TC_LOG_DEBUG("entities.transport", "Object %s removed from transport %s.", passenger->GetName().c_str(), GetName().c_str());
if (Player* plr = passenger->ToPlayer())
{
sScriptMgr->OnRemovePassenger(this, plr);
plr->SetFallInformation(0, plr->GetPositionZ());
}
}
}
@@ -722,8 +725,11 @@ void Transport::UpdatePassengerPositions(PassengerSet& passengers)
}
case TYPEID_PLAYER:
//relocate only passengers in world and skip any player that might be still logging in/teleporting
if (passenger->IsInWorld())
if (passenger->IsInWorld() && !passenger->ToPlayer()->IsBeingTeleported())
{
GetMap()->PlayerRelocation(passenger->ToPlayer(), x, y, z, o);
passenger->ToPlayer()->SetFallInformation(0, passenger->GetPositionZ());
}
break;
case TYPEID_GAMEOBJECT:
GetMap()->GameObjectRelocation(passenger->ToGameObject(), x, y, z, o, false);
+10 -1
View File
@@ -89,6 +89,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if (GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
z += GetPlayer()->GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
GetPlayer()->Relocate(loc.GetPositionX(), loc.GetPositionY(), z, loc.GetOrientation());
GetPlayer()->SetFallInformation(0, GetPlayer()->GetPositionZ());
GetPlayer()->ResetMap();
GetPlayer()->SetMap(newMap);
@@ -248,6 +249,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recvPacket)
WorldLocation const& dest = plMover->GetTeleportDest();
plMover->UpdatePosition(dest, true);
plMover->SetFallInformation(0, GetPlayer()->GetPositionZ());
uint32 newzone, newarea;
plMover->GetZoneAndAreaId(newzone, newarea);
@@ -316,9 +318,16 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
/* handle special cases */
if (movementInfo.transport.guid)
{
// We were teleported, skip packets that were broadcast before teleport
if (movementInfo.pos.GetExactDist2d(mover) > SIZE_OF_GRIDS)
{
recvData.rfinish(); // prevent warnings spam
return;
}
// transports size limited
// (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped)
if (movementInfo.transport.pos.GetPositionX() > 50 || movementInfo.transport.pos.GetPositionY() > 50 || movementInfo.transport.pos.GetPositionZ() > 50)
if (fabs(movementInfo.transport.pos.GetPositionX()) > 75.0f || fabs(movementInfo.transport.pos.GetPositionY()) > 75.0f || fabs(movementInfo.transport.pos.GetPositionZ()) > 75.0f)
{
recvPacket.rfinish(); // prevent warnings spam
return;
@@ -329,6 +329,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
// this prevent cheating with landing point at lags
// when client side flight end early in comparison server side
player->StopMoving();
player->SetFallInformation(0, player->GetPositionZ());
}
player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);
+8
View File
@@ -4465,6 +4465,10 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET)
{
// charge changes fall time
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetFallInformation(0, m_caster->GetPositionZ());
float speed = G3D::fuzzyGt(m_spellInfo->Speed, 0.0f) ? m_spellInfo->Speed : SPEED_CHARGE;
// Spell is not using explicit target - no generated path
if (m_preGeneratedPath.GetPathType() == PATHFIND_BLANK)
@@ -4555,6 +4559,10 @@ void Spell::EffectLeapBack(SpellEffIndex effIndex)
float speedz = damage/ 10.f;
//1891: Disengage
unitTarget->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891);
// changes fall time
if (m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->SetFallInformation(0, m_caster->GetPositionZ());
}
void Spell::EffectQuestClear(SpellEffIndex effIndex)