CTMod

CTMod

766k Downloads

CT_MapMod: bad argument #1 to 'SetText' in CT_Library from CT_MapMod.InsertPin

JackTrapper opened this issue ยท 1 comments

commented

Message

Interface/AddOns/CT_Library/CT_Library.lua:1889: bad argument #1 to 'SetText' (Usage: self:SetText([text]))

Stack

Interface/AddOns/CT_Library/CT_Library.lua:1889: bad argument #1 to 'SetText' (Usage: self:SetText([text]))

[string "=[C]"]: in function `SetText'
[string "@Interface/AddOns/CT_Library/CT_Library.lua"]:1889: in function `specializedHandler'
[string "@Interface/AddOns/CT_Library/CT_Library.lua"]:2590: in function <Interface/AddOns/CT_Library/CT_Library.lua:2433>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/CT_Library/CT_Library.lua"]:2664: in function <Interface/AddOns/CT_Library/CT_Library.lua:2634>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/CT_MapMod/CT_MapMod.lua"]:886: in function <Interface/AddOns/CT_MapMod/CT_MapMod.lua:856>
[string "@Interface/AddOns/CT_MapMod/CT_MapMod.lua"]:1124: in function `RequestFocus'
[string "@Interface/AddOns/CT_MapMod/CT_MapMod.lua"]:121: in function `InsertPin'
[string "@Interface/AddOns/CT_MapMod/CT_MapMod.lua"]:1278: in function `func'
[string "@Interface/SharedXML/UIDropDownMenu.lua"]:1007: in function `UIDropDownMenuButton_OnClick'
[string "*UIDropDownMenuTemplates.xml:136_OnClick"]:1: in function <[string "*UIDropDownMenuTemplates.xml:136_OnClick"]:1>

Locals

 (*temporary) = `FontString {
 0 = <userdata>
}
(*temporary) = Icon {
 0 = <userdata>
}

Game Version

/dump GetBuildInfo()
[1]="10.0.2"
[2]="46801"
[3]="Nov 23 2022"
[4]="100002"

Addon Version

CT_MapMod.lua

## Interface: 100002
## Version: 10.0.2.1
## Title: CT_MapMod
## Notes: Pins the World Map with points of interest and herb/ore nodes
## DefaultState: Enabled
## Author: Dahk (DDCorkum) using earlier work by Cide, TS, Resike
## SavedVariables: CT_MapMod_Notes, CT_MapModOptions
## Dependencies: CT_Library
## X-Part-Of: CT-Library
commented

Thanks for the detailed report.

Suspected cause:

  • CT_Library.lua:1889 is part of a factory to build labels
  • CT_MapMod.lua:886 invokes this factory to create labels such as "Name", "Icon", "Description", "x" and "y"
  • If the text supplied matches the name of a global variable, then it uses the value of that variable instead
  • Usually, no such global variables as these will exist... but any addon could create one by coincidentally the same name

Steps to reproduce:

  • /reload
  • /run x = true
  • Create a new pin on the player's current coordinates in CT_MapMod

Possible solution:

  • No longer use global variables as a substitute for text supplied to the label factory.
  • Update any part of CTMod that was depending upon this convenience for translation/localization.

Alternative (non-exclusive):

  • Some other addon is quite possibly writing a global variable when it didn't need to
  • If I knew which addon it were, I would suggest replacing x = ... with local x; x = ...