Guidelime

Guidelime

4M Downloads

Quests objectives outside of zone catagory aren't shown.

legowxelab2z8 opened this issue ยท 1 comments

commented

Coordinates do not show for quests that are in a different zone than the quest is catagorized as even if they are the only positions to advance the quest. I believe this is a result of an issue with Commit 37e2c74 which intended to "select quest coordinates in quest zone if possible "

Some quests for example Id 65 Name The Defias Brotherhood is a quest that is catagorized as Westfall. The quest has you go to Redridge to talk to an NPC. That NPC is in the internal database with world coordinates, but the world coordinates will not be added as a position since the world position can't be converted to map coordinates that are inbounds in Westfall.

The issue lies in Guidelime/Data/Guidelime_QuestsTools.lua Line 205 to 227

local positions = {}
if addon.questsDB[id] ~= nil and addon.questsDB[id].zone ~= nil then filterZone = addon.questsDB[id].zone end
for _, npcId in ipairs(ids.npc) do
local element = addon.creaturesDB[npcId]
if element ~= nil and element.positions ~= nil then
for i, pos in ipairs(element.positions) do
-- TODO: x/y are still switched in db
local x, y, zone
if filterZone == nil then
x, y, zone = addon.GetZoneCoordinatesFromWorld(pos.y, pos.x, pos.mapid)
if x == nil and addon.debugging then print("LIME: error transforming (" .. pos.x .. "," .. pos.y .. " " .. pos.mapid .. ") into zone coordinates for quest #" .. id) end
else
zone = filterZone
x, y = HBD:GetZoneCoordinatesFromWorld(pos.y, pos.x, addon.mapIDs[filterZone], true)
if x ~= nil and (x > 1 or x < 0 or y > 1 or y < 0) then x = nil end
end
if x ~= nil then
table.insert(positions, {x = math.floor(x * 10000) / 100, y = math.floor(y * 10000) / 100, zone = zone, mapID = addon.mapIDs[zone],
wx = pos.y, wy = pos.x, instance = pos.mapid})
end
end
end
end

HBD:GetZoneCoordinatesFromWorld will return values outside 0-1 when called with a zone the coordinates are not in. These out of bounds coordinates then get set to nil and then ignored.

Removing the filterZone lines and using addon.GetZoneCoordinatesFromWorld instead of HBD:GetZoneCoordinatesFromWorld with a zone specified fixes the issue above, but might revert 37e2c74

An example guide showing the effects of this issue:
[N15-24Deadmines Quests]
[QA65]
[QT65][QA132]
[QT132][QA135]
[QT135][QA141]
[QA167]
[QA168]
[QA2040]
[QT141][QA142]
[QT142][QA155]
[QT155][QA166]
[QA214]

Using the "Add quest coordinates" button in the editor will result in missing coordinates for most quests.

The result is:
[N15-24Deadmines Quests]
[G56.32,47.52Westfall][QA65]
[QT65][QA132]
[G56.32,47.52Westfall][QT132][G56.32,47.52Westfall][QA135]
[QT135][QA141]
[QA167]
[QA168]
[QA2040]
[G56.32,47.52Westfall][QT141][G56.32,47.52Westfall][QA142]
[G56.32,47.52Westfall][QT142][G55.67,47.5Westfall][QA155]
[G56.32,47.52Westfall][QT155][QA166]
[QA214]

All of these quests are catagorized as Westfall or The Deadmines which means most of these quests will not have any coordinates since they take place outside of Westfall/The Deadmines.

Using addon.GetZoneCoordinatesFromWorld instead of HBD:GetZoneCoordinatesFromWorld will result in having coordinates for all of the quests.

The result is:
[N15-24Deadmines Quests]
[G56.32,47.52Westfall][QA65]
[G25.94,41.86Redridge Mountains][QT65][G25.94,41.86Redridge Mountains][QA132]
[G56.32,47.52Westfall][QT132][G56.32,47.52Westfall][QA135]
[G78.3,70.74Stormwind City][QT135][G78.3,70.74Stormwind City][QA141]
[G70.31,40.84Stormwind City][QA167]
[G70.31,40.84Stormwind City][QA168]
[G62.62,34.11Stormwind City][QA2040]
[G56.32,47.52Westfall][QT141][G56.32,47.52Westfall][QA142]
[G56.32,47.52Westfall][QT142][G55.67,47.5Westfall][QA155]
[G56.32,47.52Westfall][QT155][G56.32,47.52Westfall][QA166]
[G56.66,47.34Westfall][QA214]

In addition to this issue filterZone is not specified as local. If there was ever an case where filterZone wasn't set because the condition
addon.questsDB[id] ~= nil and addon.questsDB[id].zone ~= nil
wasn't met then it will use an old value of filterZone potentially causing issues.

commented

Thanks for the report and all the work you have done!
While you are right of course that this is a bug, the intention of the commit that caused this problem was not only to put the correct zone name to certain coordinates but more importantly filter the list of coordinates if possible. For instance (this was the example which initiated the change) when on a quest in the human starting zone to kill wolves it makes sense to only show coordinates for wolves in Elwynn Forest. If there was no filtering wolves would be selected world-wide with the biggest cluster of mobs actually being found in Dun Morogh and therefore level 1 humans would have been sent to Dun Morogh.
The solution to this problem would be to turn off the zone filter when no coordinates have been found at all. Will change this asap.
Thanks again for your help. (Also thx for pointing out the unnecessary global I had for no reason.)