mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
fix(Core): Fix waterwalking after dying in instance (#23593)
This commit is contained in:
@@ -4409,28 +4409,6 @@ void Player::DeleteOldRecoveryItems(uint32 keepDays)
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SetMovement(PlayerMovementType pType)
|
||||
{
|
||||
WorldPacket data;
|
||||
const PackedGuid& guid = GetPackGUID();
|
||||
switch (pType)
|
||||
{
|
||||
case MOVE_WATER_WALK:
|
||||
data.Initialize(SMSG_MOVE_WATER_WALK, guid.size() + 4);
|
||||
break;
|
||||
case MOVE_LAND_WALK:
|
||||
data.Initialize(SMSG_MOVE_LAND_WALK, guid.size() + 4);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("entities.player", "Player::SetMovement: Unsupported move type ({}), data not sent to client.", pType);
|
||||
return;
|
||||
}
|
||||
data << guid;
|
||||
data << GetSession()->GetOrderCounter(); // movement counter
|
||||
SendDirectMessage(&data);
|
||||
GetSession()->IncrementOrderCounter();
|
||||
}
|
||||
|
||||
/* Preconditions:
|
||||
- a resurrectable corpse must not be loaded for the player (only bones)
|
||||
- the player must be in world
|
||||
@@ -4466,7 +4444,6 @@ void Player::BuildPlayerRepop()
|
||||
}
|
||||
GetMap()->AddToMap(corpse);
|
||||
SetHealth(1); // convert player body to ghost
|
||||
SetMovement(MOVE_WATER_WALK);
|
||||
SetWaterWalking(true);
|
||||
|
||||
if (!IsImmobilizedState())
|
||||
@@ -4507,7 +4484,6 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
|
||||
setDeathState(DeathState::Alive);
|
||||
SetMovement(MOVE_LAND_WALK);
|
||||
SendMoveRoot(false);
|
||||
SetWaterWalking(false);
|
||||
m_deathTimer = 0;
|
||||
@@ -11689,7 +11665,7 @@ void Player::SendInitialPacketsAfterAddToMap()
|
||||
GetSession()->IncrementOrderCounter();
|
||||
}
|
||||
|
||||
if (HasAuraType(SPELL_AURA_WATER_WALK))
|
||||
if (HasAuraType(SPELL_AURA_WATER_WALK) || HasAura(8326))
|
||||
{
|
||||
uint32 const counter = GetSession()->GetOrderCounter();
|
||||
setCompoundState << uint8(2 + GetPackGUID().size() + 4);
|
||||
@@ -12096,18 +12072,6 @@ void Player::GetAurasForTarget(Unit* target, bool force /*= false*/)
|
||||
if (!target || (!force && target->GetVisibleAuras()->empty())) // speedup things
|
||||
return;
|
||||
|
||||
/*! Blizz sends certain movement packets sometimes even before CreateObject
|
||||
These movement packets are usually found in SMSG_COMPRESSED_MOVES
|
||||
*/
|
||||
if (target->HasFeatherFallAura())
|
||||
target->SendMovementFeatherFall(this);
|
||||
|
||||
if (target->HasWaterWalkAura())
|
||||
target->SendMovementWaterWalking(this);
|
||||
|
||||
if (target->HasHoverAura())
|
||||
target->SendMovementHover(this);
|
||||
|
||||
WorldPacket data(SMSG_AURA_UPDATE_ALL);
|
||||
data<< target->GetPackGUID();
|
||||
|
||||
|
||||
@@ -2059,8 +2059,6 @@ public:
|
||||
}
|
||||
bool IsMirrorTimerActive(MirrorTimerType type) { return m_MirrorTimer[type] == getMaxTimer(type); }
|
||||
|
||||
void SetMovement(PlayerMovementType pType);
|
||||
|
||||
bool CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone);
|
||||
|
||||
void JoinedChannel(Channel* c);
|
||||
|
||||
@@ -950,7 +950,6 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
pCurrChar->CastSpell(pCurrChar, 20584, true, 0); // auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
|
||||
|
||||
pCurrChar->CastSpell(pCurrChar, 8326, true, 0); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?)
|
||||
pCurrChar->SetMovement(MOVE_WATER_WALK);
|
||||
}
|
||||
|
||||
// Set FFA PvP for non GM in non-rest mode
|
||||
|
||||
@@ -156,13 +156,13 @@ public:
|
||||
if (enable)
|
||||
{
|
||||
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK);
|
||||
handler->GetSession()->GetPlayer()->SetMovement(MOVE_WATER_WALK); // ON
|
||||
handler->GetSession()->GetPlayer()->SetWaterWalking(true); // ON
|
||||
handler->SendSysMessage("Waterwalking is ON. You can walk on water.");
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK);
|
||||
handler->GetSession()->GetPlayer()->SetMovement(MOVE_LAND_WALK); // OFF
|
||||
handler->GetSession()->GetPlayer()->SetWaterWalking(false); // OFF
|
||||
handler->SendSysMessage("Waterwalking is OFF. You can't walk on water.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user