Bug report when trying to view match history
SkyBats opened this issue ยท 1 comments
Any trainer, click on history. The following bug message
"Date: 2020-07-10 15:57:48
ID: 1
Error occured in: Global
Count: 1
Message: ...nterface\AddOns\PetTracker\addons\journal\record.lua line 74:
attempt to perform arithmetic on local 'date' (a string value)
Debug:
[string "@PetTracker\addons\journal\record.lua"]:74: UnpackDate()
[string "@PetTracker\addons\journal\record.lua"]:58: Unpack()
[string "@PetTracker\addons\journal\record.lua"]:28: Display()
[string "@PetTracker\addons\journal\rivals.lua"]:265: Display()
[string "@PetTracker\addons\journal\rivals.lua"]:187: Update()
[string "@PetTracker\addons\journal\rivals.lua"]:125: SetTab()
[string ":OnClick"]:2:
[string ":OnClick"]:1
Locals:
self = {
NormalTexture = {
}
HighlightTexture = {
}
won = true
Selected = {
}
Content = {
}
0 =
}
date = "97b"
yearDate = 195
(*temporary) = 10
(*temporary) = 7
(*temporary) = defined =[C]:-1
(*temporary) = 6
(*temporary) = "attempt to perform arithmetic on local 'date' (a string value)"
AddOns:
Swatter, v8.2.6511 (SwimmingSeadragon)
PetTracker, v8.3.8
PetTrackerJournal, v
BlizRuntimeLib_ruRU v8.3.0.80300
(ck=7f)
"
some bug with date format.
AddOns\PetTracker\addons\journal\record.lua line 74
deleting the following fragment
floor(date / 31 / 12) +
seems to roughly fix it
The return in the Record:UnpackDate() has an error when attempting to render the third argument. Which should be the year.
You need to have a tonumber(date) call in there to render the date string to a number so the calculation will work.
Or you can do this:
function Record:UnpackDate(date) local yearDate = tonumber(date, 16) % (31*12) local yearOnly = ((tonumber(date, 16) % (32 * 12)) / 31) + 2014 return yearDate % 31 + 1, floor(yearDate / 31) + 1, yearOnly end