Core/Spells: Reinstate helperfunction removed in commit 0e3607df (with a new functionname to make more sense out of it), and adjust the remaining code slightly to accomodate that.

This commit is contained in:
click committed 2015-04-07 23:51:19 +02:00
1 parent b321f84a39
commit 6c1e4bc20d
3 files changed
+14 -8

No files matched your search

+5 -8
View File
@@ -1482,15 +1482,12 @@ 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)
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id);
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
{
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
}
if (skillIter->second->skillId == SKILL_MOUNTS)
if (player && !player->canFlyInZone(map_id, zone_id))
return SPELL_FAILED_INCORRECT_AREA;
}
}
}