Thread Tools Display Modes
09/07/15, 12:36 PM   #1
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
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
  Reply With Quote
09/07/15, 12:46 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
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.
  Reply With Quote
09/07/15, 12:51 PM   #3
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 129
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.
  Reply With Quote
09/07/15, 01:23 PM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Thx for the infos guys. I'll check the addons and their librarys.
  Reply With Quote
09/08/15, 03:20 AM   #5
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
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?
  Reply With Quote
09/08/15, 03:52 AM   #6
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 129
Looks like nil instead of callback error to me.
  Reply With Quote
09/08/15, 04:22 AM   #7
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
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)

Last edited by merlight : 09/08/15 at 04:31 AM. Reason: wrong table
  Reply With Quote
09/08/15, 04:53 AM   #8
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Ayantir View Post
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.
  Reply With Quote
09/08/15, 06:04 AM   #9
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 129
Originally Posted by Garkin View Post
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

Last edited by Fyrakin : 09/08/15 at 06:07 AM.
  Reply With Quote
09/08/15, 05:12 PM   #10
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 171
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!
  Reply With Quote
09/11/15, 07:40 AM   #11
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Thanks for the information.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Getting a lua error with worldmap, if you choose the revive location

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off