fix(Core/Spell): Make use of SPELL_ATTR7_IGNORE_COLD_WEATHER_FLYING (#4933)

This commit is contained in:
Kitzunu
2021-03-25 01:19:57 +01:00
committed by GitHub
parent 83e430f28a
commit fb5d2fa2e5
5 changed files with 47 additions and 27 deletions

View File

@@ -25520,11 +25520,19 @@ uint32 Player::CalculateTalentsPoints() const
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
}
bool Player::canFlyInZone(uint32 mapid, uint32 zone) const
bool Player::canFlyInZone(uint32 mapid, uint32 zone, SpellInfo const* bySpell) const
{
// continent checked in SpellInfo::CheckLocation at cast and area update
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
return v_map != 571 || HasSpell(54197); // 54197 = Cold Weather Flying
if (v_map == 571 && !bySpell->HasAttribute(SPELL_ATTR7_IGNORE_COLD_WEATHER_FLYING))
{
if (!HasSpell(54197)) // 54197 = Cold Weather Flying
{
return false;
}
}
return true;
}
void Player::learnSpellHighRank(uint32 spellid)