aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorclick <click@gonnamakeyou.com>2015-04-13 12:59:04 +0100
committerDDuarte <dnpd.dd@gmail.com>2015-04-14 01:02:08 +0100
commit0192a602d6f19cfb4d90aaf0e6c797ed0a198c1f (patch)
tree7e0fcf37507dc3194c9fec20fce0fb55054d6b17 /src
parenta7a84f99d216221d34cc7e5d4899a687ee3efa01 (diff)
Core/Spells: Allow non-skill-based flying mounts to be used in designated areas.
- Flying mounts that are not in the "SKILL_MOUNT"-tree and area-restricted can now be used properly (ex. 64749 - Loaned Gryphon). - Remove isKnowHowFlyIn()-function (useless and deprecated since this is handled properly in the spellsystem). Massive thanks to rat for extremely good help and support on fixing this (most of this is his work). (cherry picked from commit 0e3607df5b6df0e85a458cbd37da124f7fa58825) Core/Spells: Reinstate helperfunction removed in commit 0e3607d (with a new functionname to make more sense out of it), and adjust the remaining code slightly to accomodate that. (cherry picked from commit 6c1e4bc20d68d9fb548eb4896bd8b84a4c3ec4ff)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp4
-rw-r--r--src/server/game/Entities/Player/Player.h2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp10
3 files changed, 10 insertions, 6 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 5dffaf428dc..62b935b598e 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -24630,11 +24630,11 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
SendEquipError(msg, NULL, NULL, item->itemid);
}
-bool Player::IsKnowHowFlyIn(uint32 mapid, uint32 zone) const
+bool Player::canFlyInZone(uint32 mapid, uint32 zone) const
{
// continent checked in SpellInfo::CheckLocation at cast and area update
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
- return v_map != 571 || HasSpell(54197); // Cold Weather Flying
+ return v_map != 571 || HasSpell(54197); // 54197 = Cold Weather Flying
}
void Player::LearnSpellHighestRank(uint32 spellid)
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 9ddcf6ed92d..07669bab025 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2396,7 +2396,7 @@ class Player : public Unit, public GridObject<Player>
void SetFallInformation(uint32 time, float z);
void HandleFall(MovementInfo const& movementInfo);
- bool IsKnowHowFlyIn(uint32 mapid, uint32 zone) const;
+ bool canFlyInZone(uint32 mapid, uint32 zone) const;
void SetClientControl(Unit* target, bool allowMove);
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index eb09cc60a1f..77fbd9a8332 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1815,9 +1815,13 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
{
case SPELL_AURA_FLY:
{
- if (!player->IsKnowHowFlyIn(map_id, zone_id))
- return SPELL_FAILED_INCORRECT_AREA;
- break;
+ SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id);
+ for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
+ {
+ if (skillIter->second->skillId == SKILL_MOUNTS)
+ if (!player->canFlyInZone(map_id, zone_id))
+ return SPELL_FAILED_INCORRECT_AREA;
+ }
}
case SPELL_AURA_MOUNTED:
{