fix(Core): Fix waterwalking after dying in instance (#23593)

This commit is contained in:
killerwife
2025-11-12 15:54:29 +01:00
committed by GitHub
parent 621e9e853f
commit 2f9d3a1a71
4 changed files with 3 additions and 42 deletions
+1 -37
View File
@@ -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: /* Preconditions:
- a resurrectable corpse must not be loaded for the player (only bones) - a resurrectable corpse must not be loaded for the player (only bones)
- the player must be in world - the player must be in world
@@ -4466,7 +4444,6 @@ void Player::BuildPlayerRepop()
} }
GetMap()->AddToMap(corpse); GetMap()->AddToMap(corpse);
SetHealth(1); // convert player body to ghost SetHealth(1); // convert player body to ghost
SetMovement(MOVE_WATER_WALK);
SetWaterWalking(true); SetWaterWalking(true);
if (!IsImmobilizedState()) if (!IsImmobilizedState())
@@ -4507,7 +4484,6 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND); SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND);
setDeathState(DeathState::Alive); setDeathState(DeathState::Alive);
SetMovement(MOVE_LAND_WALK);
SendMoveRoot(false); SendMoveRoot(false);
SetWaterWalking(false); SetWaterWalking(false);
m_deathTimer = 0; m_deathTimer = 0;
@@ -11689,7 +11665,7 @@ void Player::SendInitialPacketsAfterAddToMap()
GetSession()->IncrementOrderCounter(); GetSession()->IncrementOrderCounter();
} }
if (HasAuraType(SPELL_AURA_WATER_WALK)) if (HasAuraType(SPELL_AURA_WATER_WALK) || HasAura(8326))
{ {
uint32 const counter = GetSession()->GetOrderCounter(); uint32 const counter = GetSession()->GetOrderCounter();
setCompoundState << uint8(2 + GetPackGUID().size() + 4); 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 if (!target || (!force && target->GetVisibleAuras()->empty())) // speedup things
return; 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); WorldPacket data(SMSG_AURA_UPDATE_ALL);
data<< target->GetPackGUID(); data<< target->GetPackGUID();
-2
View File
@@ -2059,8 +2059,6 @@ public:
} }
bool IsMirrorTimerActive(MirrorTimerType type) { return m_MirrorTimer[type] == getMaxTimer(type); } bool IsMirrorTimerActive(MirrorTimerType type) { return m_MirrorTimer[type] == getMaxTimer(type); }
void SetMovement(PlayerMovementType pType);
bool CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone); bool CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone);
void JoinedChannel(Channel* c); 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, 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->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 // Set FFA PvP for non GM in non-rest mode
+2 -2
View File
@@ -156,13 +156,13 @@ public:
if (enable) if (enable)
{ {
handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK); 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."); handler->SendSysMessage("Waterwalking is ON. You can walk on water.");
} }
else else
{ {
handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK); 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."); handler->SendSysMessage("Waterwalking is OFF. You can't walk on water.");
} }