You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is continuation of bug report #5942 (fixed in r26585).
Squirell now handles int64 well, but when I want to display number higher than uint32_max in gui as string, it fails.
Savegame, sample game script and screenshot enclosed. String code used in example is CURRENCY_LONG, CURENCY_SHORT and COMMA.
I did little research and the results are
in src/script/api/script_text.cpp in function SQInteger ScriptText::_SetParam(int parameter, HSQUIRRELVM vm)
are GSText integer parametres save into this->parami[parameter] = value; (LINE 95)
in src/script/api/script_text.hpp
is parami declared as int parami[SCRIPT_TEXT_MAX_PARAMETERS]; (LINE 132)
So every int64 passed here is cut to int32 (at least on 32-bit system)
Furthermore back in script_text.cpp in function char *ScriptText::_GetEncodedText(char *p, char *lastofp, int ¶m_count)
are int64 parameters made as uint32 p += seprintf(p, lastofp,":%X", (uint32)this->parami[i]); (LINE 204)
Declaring parami to int64 and removint the (uint32) change type itself does not help though, there is more to that, which I have not discovered.
I think the attached patch solves the issue; it seems to do so for me, but I don't have a 32 bits environment to properly test it. Could you please test it?
strtoull is unknown to MSVCRT, so there is needed some define in stdafx.cpp. (diff 1)
Also I found out, that GSList stores again only 32 bit values. As GSList is often used to store various values like scores, it would be good to make it store int64 too. (diff 2)
Both patches works with 32 and 64bit compiled executable on win7 64bit and 32bit works the same on winXP 32bit for me.
The_Dude opened the ticket and wrote:
Attachments
Reported version: 1.5.0-beta1
Operating system: All
This issue was imported from FlySpray: https://bugs.openttd.org/task/6194
The text was updated successfully, but these errors were encountered: