aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorclick <click@gonnamakeyou.com>2015-04-07 21:26:23 +0200
committerclick <click@gonnamakeyou.com>2015-04-07 21:26:23 +0200
commit0e3607df5b6df0e85a458cbd37da124f7fa58825 (patch)
treeb2a1ce9603ad80692f77fc755b5ce1d70133e763 /src
parentdcd36c1bf61fdb01696d382667f84531f74b2f6f (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).
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp7
-rw-r--r--src/server/game/Entities/Player/Player.h2
-rw-r--r--src/server/game/Spells/SpellInfo.cpp13
3 files changed, 10 insertions, 12 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 1a8c250bfb9..e2da8e1e8d9 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -25085,13 +25085,6 @@ uint32 Player::CalculateTalentsPoints() const
return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT));
}
-bool Player::IsKnowHowFlyIn(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
-}
-
void Player::LearnSpellHighestRank(uint32 spellid)
{
LearnSpell(spellid, false);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index e6ff939d881..8394193f8c1 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -2136,8 +2136,6 @@ 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;
-
void SetClientControl(Unit* target, bool allowMove);
void SetMover(Unit* target);
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 862521a068c..79db8672a4f 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1482,12 +1482,19 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
case SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED:
case SPELL_AURA_FLY:
{
- if (player && !player->IsKnowHowFlyIn(map_id, zone_id))
- return SPELL_FAILED_INCORRECT_AREA;
+ if (player)
+ {
+ SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id);
+ for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
+ {
+ // spell 54197 (Cold Weather Flying) is a prereq for flying in Northrend
+ if (skillIter->second->skillId == SKILL_MOUNTS && player->GetMapId() != 571 && !player->HasSpell(54197))
+ return SPELL_FAILED_INCORRECT_AREA; // maybe: SPELL_CUSTOM_ERROR_CANT_USE_THAT_MOUNT
+ }
+ }
}
}
}
-
return SPELL_CAST_OK;
}