Skip to content

Commit

Permalink
Fixes #68 - Implement check for nil parent in GetMapUntil()
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Nov 2, 2018
1 parent d123922 commit f1e76fe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions BeStride.lua
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,8 @@ end

function BeStride:GetMapUntil(locID,filter)
local map = C_Map.GetMapInfo(locID)
if map["mapType"] ~= filter and map["mapType"] > filter then
return BeStride:GetMapUntil(map["parentMapID"],filter)
if map.mapType ~= filter and map.mapType > filter and map.parentMapID ~= nil and map.parentMapID ~= 0 then
return BeStride:GetMapUntil(map.parentMapID,filter)
else
return map
end
Expand Down
4 changes: 2 additions & 2 deletions BeStride_Debug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ function BeStride_Debug:DebugGetMapUntil(locID,filter)
if map ~= nil then
self:Debug(map.mapID .. "," .. map.name .. "," .. map.mapType .. "," .. map.parentMapID)
end
if map["mapType"] ~= filter and map["mapType"] > filter then
return self:DebugGetMapUntil(map["parentMapID"],filter)
if map.mapType ~= filter and map.mapType > filter and map.parentMapID ~= nil and map.parentMapID ~= 0 then
return self:DebugGetMapUntil(map.parentMapID,filter)
else
return map
end
Expand Down
1 change: 0 additions & 1 deletion localization/en-US.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


BeStride_Locale = {
Options = {
OpenGUI = "Open GUI"
Expand Down
8 changes: 7 additions & 1 deletion localization/zh-TW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ if GetLocale() == "zhTW" then
Passenger = "強制多載坐騎按鈕"
},
Zone = {
AzuremystIsle = {
Name = "Azuremyst Isle"
},
BloodmystIsle = {
Name = "Bloodmyst Isle"
},
Deadmines = {
Name = "死亡礦坑"
},
Expand Down Expand Up @@ -169,4 +175,4 @@ if GetLocale() == "zhTW" then
}
}
}
end
end

0 comments on commit f1e76fe

Please sign in to comment.