Integer values are displayed as float
Before creating an issue, please ensure:
- [x] This is a bug in the software that resides in this repository, and not a support matter (use https://otland.net/forums/support.16/ for support)
- [x] This issue is reproducible without changes to the C++ code in this repository
Steps to reproduce (include any configuration/script required to reproduce)
Some values are shown as floating point (probably related to changes in lua 5.3+)
- Look at watch to see the time
- execute
/clean - execute
!pos - step on depot tile (item count)
FYI: I achieved expected behavior thanks to some changes in code:
- changed
lua_pushnumbertolua_pushinteger(ofc. not everywhere because for e.g. ExperienceStages are of type float)
Expected behaviour
All of these numbers should be presented as integer:
Actual behaviour
- watch time
!poscordinates/cleanresult message- depot item count
Environment
TFS master branch: 954bb014ee3a5320fa2cd291922ff178c5b7a0a5 (unmodified)
Windows 10 Pro (22H2)
Microsoft Visual Studio 2022
Debug/Release x64
Lua version: 5.4.4
OTClient (mehah)
On luaJIT it works fine, so it's not a big problem
Definitely related to Lua 5.4, since it separated floating point numbers from integers and we only push floating point due to LuaJIT not supporting integers. The easy solution is to just drop LuaJIT support, it's not as useful as it used to be and is stuck in Lua 5.1