ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Getting a lua error with worldmap, if you choose the revive location (https://www.esoui.com/forums/showthread.php?t=5131)

Baertram 09/07/15 12:36 PM

Getting a lua error with worldmap, if you choose the revive location
 
I'm getting an error message if I try to choose my revive location, after a death.

Code:

Map/WorldMapFilters_Shared.lua:40 - attempt to index a nil value
Here is a screenshot with the error message:


It appears the most inside the imperial city.
Anyone knows where this comes from, and if we can fix this?

Thanks

Garkin 09/07/15 12:46 PM

This issue is caused by some addon which is trying to access map filters in Imperial City context which does not exist. It could be for example old version of LibMapPins library, but I believe that it was fixed in LMP r10.

Fyrakin 09/07/15 12:51 PM

If its an add-on using outdated library it would be better to fix it there. Though technically it can be fixed by adding a patch add-on.

Baertram 09/07/15 01:23 PM

Thx for the infos guys. I'll check the addons and their librarys.

Ayantir 09/08/15 03:20 AM

got same error, checked, all my active addons use r10 of libmappins.
ps: in the error, it's CustomCompassPins the guilty. Does this one is IC ready?

Fyrakin 09/08/15 03:52 AM

Looks like nil instead of callback error to me.

merlight 09/08/15 04:22 AM

Map/WorldMapFilters_Shared.lua:40
Lua Code:
  1. return self.modeVars.filters[self.mapFilterType][mapPinGroup]

My guess is that filters[self.mapFilterType] is nil there. If you check ./ingame/map/worldmap.lua +6238, you'll see there aren't filters[mapFilterType] tables for every mapMode/mapFilterType combination.

Edit: specifically, MAP_MODE_AVA_RESPAWN doesn't have filters for MAP_FILTER_TYPE_AVA_IMPERIAL

Edit2: Can't test it myself
Lua Code:
  1. CALLBACK_MANAGER:RegisterCallback("OnWorldMapSavedVarsReady", function(savedVars)
  2.     local filters = savedVars[MAP_MODE_AVA_RESPAWN].filters
  3.     if not filters[MAP_FILTER_TYPE_AVA_IMPERIAL] then
  4.         filters[MAP_FILTER_TYPE_AVA_IMPERIAL] = {}
  5.     end
  6. end)

Garkin 09/08/15 04:53 AM

Quote:

Originally Posted by Ayantir (Post 23352)
got same error, checked, all my active addons use r10 of libmappins.
ps: in the error, it's CustomCompassPins the guilty. Does this one is IC ready?

CustomCompassPins fires callback "OnWorldMapChanged" and error occurs in callback handler. Is it really CustomCompassPins fault?

Error occurs in this function:

Lua Code:
  1. function ZO_WorldMapFilterPanel_Shared:GetPinFilter(mapPinGroup)
  2.     if self.modeVars then
  3.         return self.modeVars.filters[self.mapFilterType][mapPinGroup]
  4.     end
  5.     return nil
  6. end

Because self.modeVars.filters[self.mapFilterType] is nil.
(In this case self = WORLD_MAP_FILTERS.imperialPvPPanel and self.modeVars = self.savedVars[mapMode])

I wonder if it is because ZO_WorldMap_GetMode() returns invalid value (mapMode is invalid or nil). But I can't be sure unless I do some tests.

Fyrakin 09/08/15 06:04 AM

Quote:

Originally Posted by Garkin (Post 23355)
CustomCompassPins fires callback "OnWorldMapChanged" and error occurs in callback handler. Is it really CustomCompassPins fault?

Error occurs in this function:

Lua Code:
  1. function ZO_WorldMapFilterPanel_Shared:GetPinFilter(mapPinGroup)
  2.     if self.modeVars then
  3.         return self.modeVars.filters[self.mapFilterType][mapPinGroup]
  4.     end
  5.     return nil
  6. end

Because self.modeVars.filters[self.mapFilterType] is nil.
(In this case self = WORLD_MAP_FILTERS.imperialPvPPanel and self.modeVars = self.savedVars[mapMode])

I wonder if it is because ZO_WorldMap_GetMode() returns invalid value (mapMode is invalid or nil). But I can't be sure unless I do some tests.

I would write a patch add-on for this problem (or maybe add it to MapFix?)
Lua Code:
  1. local _GetPinFilter = _G["ZO_WorldMapFilterPanel_Shared"].GetPinFilter
  2. local function GetPinFilter (obj, mapPinGroup)
  3.     if obj.modeVars then
  4.         if obj.modeVars.filters and obj.mapFilterType then
  5.             if obj.modeVars.filters[obj.mapFilterType] then
  6.                 return obj.modeVars.filters[obj.mapFilterType][mapPinGroup]
  7.             end
  8.         end
  9.     end
  10.     return nil
  11. end
  12. _G["ZO_WorldMapFilterPanel_Shared"].GetPinFilter = GetPinFilter

ZOS_DanBatson 09/08/15 05:12 PM

In response to this thread I implemented a fix for this error internally this morning. We'll get it out to you as soon as we're able. Thanks!

Baertram 09/11/15 07:40 AM

Thanks for the information.


All times are GMT -6. The time now is 11:37 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI