Skip to content

Commit

Permalink
Remove workaround for 7.3.5 bug (fixed)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phanx committed May 4, 2018
1 parent 9e386e7 commit 31fd2b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 50 deletions.
37 changes: 2 additions & 35 deletions LibFlyable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,6 @@ local spellForContinent = {
[1479] = -1, -- Skyhold (Warrior)
}

-- Workaround for bug in patch 7.3.5
local flyableContinents = {
-- These continents previously required special spells to fly in.
-- All such spells were removed from the game in patch 7.3.5, but
-- the IsFlyableArea() API function was not updated accordingly,
-- and incorrectly returns false on these continents for characters
-- who did not know the appropriate spell before the patch.
[ 0] = true, -- Eastern Kingdoms (Flight Master's License)
[ 1] = true, -- Kalimdor (Flight Master's License)
[646] = true, -- Deepholm (Flight Master's License)
[571] = true, -- Northrend (Cold Weather Flying)
[870] = true, -- Pandaria (Wisdom of the Four Winds)
}

-- Workaround for bug in patch 7.3.5
local noFlyZones = {
-- These zones are not flyable, and IsFlyableArea() correctly returns
-- false there, but are on continents affected by the 7.3.5 bug.
[GetMapNameByID(951) or "ERROR"] = true, -- Timeless Isle
}

local noFlySubzones = {
-- Unflyable subzones where IsFlyableArea() returns true:
["Nespirah"] = true, ["Неспира"] = true, ["네스피라"] = true, ["奈瑟匹拉"] = true, ["奈斯畢拉"] = true,
Expand All @@ -87,8 +66,8 @@ local IsFlyableArea = IsFlyableArea
local IsSpellKnown = IsSpellKnown

function lib.IsFlyableArea()
-- if not IsFlyableArea() -- Untrustable in patch 7.3.5
if noFlySubzones[GetSubZoneText() or ""] then
if not IsFlyableArea()
or noFlySubzones[GetSubZoneText() or ""] then
return false
end

Expand All @@ -98,17 +77,5 @@ function lib.IsFlyableArea()
return reqSpell > 0 and IsSpellKnown(reqSpell)
end

-- Workaround for bug in patch 7.3.5
-- IsFlyableArea() incorrectly reports false in many locations for
-- characters who did not have a zone-specific flying spell before
-- the patch (which removed all such spells from the game).
if not IsFlyableArea() and not flyableContinents[instanceMapID] then
-- Continent is not affected by the bug. API is correct.
return false
elseif flyableContinents[instanceMapID] and noFlyZones[GetZoneText() or ""] then
-- Continent is affected, but API is correct, zone is not flyable.
return false
end

return IsSpellKnown(34090) or IsSpellKnown(34091) or IsSpellKnown(90265)
end
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@
Avoids these long-standing bugs with IsFlyableArea:

- Broken Isles zones are only flyable with the Broken Isles Pathfinder ability.
- Draenor zones (including the garrison) are only flyable with the Draenor Pathfinder ability.
- Ashran (PvP) and the Tanaan Jungle Intro are *never* flyable.

Also avoids the new bugs introduced in Patch 7.3.5:

- Pandaria zones no longer require Wisdom of the Four Winds.
- Northrend zones no longer require Cold Weather Flying.
- Eastern Kingdoms, Kalimdor, and Deepholm no longer require Flight Master's License.

These spells were removed from the game, and all characters can fly in these
zones, but IsFlyableArea returns false for characters who had not previously
learned the appropriate spell.
- Draenor zones are only flyable with the Draenor Pathfinder ability.
- Certain maps like Argus and the Tanaan Jungle Intro are not flyable.
- Certain Legion class halls are not flyable.


## Usage
Expand All @@ -26,11 +17,11 @@ lib = LibStub("LibFlyable")
isFlyable = lib:IsFlyableArea() -- true/false
```

**Source code and bug reports on GitHub:**
**Source code and bug reports on GitHub:**
<https://github.com/phanx-wow/LibFlyable>

**URL to use with the CurseForge packager:**
`https://repos.curseforge.com/wow/libflyable`
**URL to use with the CurseForge packager:**
`https://repos.curseforge.com/wow/libflyable`
Only tagged releases are pushed to CurseForge, so using this URL will ensure
the packager always gives you a tested and stable version of the library.

Expand Down

0 comments on commit 31fd2b6

Please sign in to comment.