mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-23 04:04:36 +00:00
fix(Core/Unit): Fix dying from fall damage and incorrect flying on map teleport (#23465)
This commit is contained in:
@@ -418,7 +418,7 @@ Player::Player(WorldSession* session): Unit(), m_mover(this)
|
||||
|
||||
sScriptMgr->OnConstructPlayer(this);
|
||||
|
||||
m_expectingChangeTransport = false;
|
||||
_expectingChangeTransport = false;
|
||||
}
|
||||
|
||||
Player::~Player()
|
||||
@@ -1549,6 +1549,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
||||
//remove auras before removing from map...
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CHANGE_MAP | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING);
|
||||
|
||||
SetMapChangeOrderCounter();
|
||||
|
||||
if (!GetSession()->PlayerLogout())
|
||||
{
|
||||
// send transfer packets
|
||||
|
||||
@@ -2633,8 +2633,14 @@ public:
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
bool IsExpectingChangeTransport() const { return m_expectingChangeTransport; }
|
||||
void SetExpectingChangeTransport(bool state) { m_expectingChangeTransport = state; }
|
||||
bool IsExpectingChangeTransport() const { return _expectingChangeTransport; }
|
||||
void SetExpectingChangeTransport(bool state) { _expectingChangeTransport = state; }
|
||||
|
||||
uint32 GetPendingFlightChange() const { return _pendingFlightChangeCounter; }
|
||||
void SetPendingFlightChange(uint32 counter) { _pendingFlightChangeCounter = counter; }
|
||||
|
||||
void SetMapChangeOrderCounter() { _mapChangeOrderCounter = GetSession()->GetOrderCounter(); }
|
||||
uint32 GetMapChangeOrderCounter() { return _mapChangeOrderCounter; }
|
||||
|
||||
/*********************************************************/
|
||||
/*** SPELL QUEUE SYSTEM ***/
|
||||
@@ -3017,7 +3023,9 @@ private:
|
||||
|
||||
Seconds m_creationTime;
|
||||
|
||||
bool m_expectingChangeTransport;
|
||||
bool _expectingChangeTransport;
|
||||
uint32 _pendingFlightChangeCounter;
|
||||
uint32 _mapChangeOrderCounter;
|
||||
};
|
||||
|
||||
void AddItemsSetItem(Player* player, Item* item);
|
||||
|
||||
@@ -20403,6 +20403,7 @@ void Unit::SetCanFly(bool enable)
|
||||
if (Player const* player = GetClientControlling())
|
||||
{
|
||||
uint32 const counter = player->GetSession()->GetOrderCounter();
|
||||
const_cast<Player*>(player)->SetPendingFlightChange(counter);
|
||||
|
||||
WorldPacket data(enable ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, GetPackGUID().size() + 4);
|
||||
data << GetPackGUID();
|
||||
|
||||
Reference in New Issue
Block a user