mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
fix(Core/Entities): Improve interactions between taxis and players regarding PvP flag. (#23681)
This commit is contained in:
@@ -1439,6 +1439,9 @@ void Player::UpdatePvPState()
|
||||
|
||||
if (pvpInfo.IsHostile) // in hostile area
|
||||
{
|
||||
if (IsInFlight()) // on taxi
|
||||
return;
|
||||
|
||||
if (!IsPvP() || pvpInfo.EndTimer != 0)
|
||||
UpdatePvP(true, true);
|
||||
}
|
||||
|
||||
@@ -1864,7 +1864,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
|
||||
auto canTakeMeleeDamage = [&]()
|
||||
{
|
||||
return victim->IsAlive() && !victim->HasUnitState(UNIT_STATE_IN_FLIGHT) && (!victim->IsCreature() || !victim->ToCreature()->IsEvadingAttacks());
|
||||
return victim->IsAlive() && !victim->IsInFlight() && (!victim->IsCreature() || !victim->ToCreature()->IsEvadingAttacks());
|
||||
};
|
||||
|
||||
if (!canTakeMeleeDamage())
|
||||
@@ -18196,10 +18196,8 @@ void Unit::SetControlled(bool apply, UnitState state, Unit* source /*= nullptr*/
|
||||
|
||||
void Unit::SetStunned(bool apply)
|
||||
{
|
||||
if (HasUnitState(UNIT_STATE_IN_FLIGHT))
|
||||
{
|
||||
if (IsInFlight())
|
||||
return;
|
||||
}
|
||||
|
||||
if (apply)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user