Thread Tools Display Modes
Prev Previous Post   Next Post Next
12/06/21, 09:18 AM   #1
MrPikPik
AddOn Author - Click to view addons
Join Date: Nov 2019
Posts: 3
[notabug] GetAchievementTimestamp(number achievementId) returns wrong datatype

Hello everyone,

I noticed the function "GetAchievementTimestamp(number achievementId)" returns "wrong" values.
For my understanding the function expects a number, the id of an achievement, and should return a unix timestamp of the completion date of the given achievement or 0 if it hasn't been completed.


Calling the function for completed achievements however, the return value is a floating point number.

I did some investigation with the number the function returned: In my example, the returned number was "7.8484867882774e-315". The 64 bits of that double are "0000000000000000000000000000000001011110101011110101111011110011". When you interpret these bits as an unsigned long you get the value "1588551411", which is the actual unix timestamp of completion of the achievement I fed into the function, May 4th 2020.

Seems like the lua backend just interprets the memory as the wrong data type so the issue should be easily fixable trough some pointer-casting-magic

Unfortunatly I am unable to tell if this is a recent bug or if it has been in the game for longer.

I hope this is helpful for the devs
 
 

ESOUI » Developer Discussions » Bug Reports » [notabug] GetAchievementTimestamp(number achievementId) returns wrong datatype


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