Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer values are displayed as float #4522

Open
2 tasks done
xmish opened this issue Sep 1, 2023 · 3 comments
Open
2 tasks done

Integer values are displayed as float #4522

xmish opened this issue Sep 1, 2023 · 3 comments
Labels
bug An issue describing unexpected behavior of code priority: high
Milestone

Comments

@xmish
Copy link
Contributor

xmish commented Sep 1, 2023

Before creating an issue, please ensure:

  • 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)
  • 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+)

  1. Look at watch to see the time
  2. execute /clean
  3. execute !pos
  4. step on depot tile (item count)

FYI: I achieved expected behavior thanks to some changes in code:

  • changed lua_pushnumber to lua_pushinteger (ofc. not everywhere because for e.g. ExperienceStages are of type float)

Expected behaviour

All of these numbers should be presented as integer:

image

Actual behaviour

  • watch time
  • !pos cordinates
  • /clean result message
  • depot item count

image

Environment

TFS master branch: 954bb01 (unmodified)
Windows 10 Pro (22H2)
Microsoft Visual Studio 2022
Debug/Release x64
Lua version: 5.4.4
OTClient (mehah)

@xmish
Copy link
Contributor Author

xmish commented Sep 2, 2023

On luaJIT it works fine, so it's not a big problem

@EvilHero90 EvilHero90 added the priority: low Issues with this label won’t have the immediate focus label May 14, 2024
@ranisalt
Copy link
Member

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

@EvilHero90 EvilHero90 added this to the 1.8 milestone May 26, 2024
@nekiro
Copy link
Member

nekiro commented Dec 9, 2024

It's definitely not a small problem, it's not only visual. It breaks the code, for example string.format called on a double value with %d will throw an error, so everywhere, where it's used it may break code unexpectedly.

@nekiro nekiro added the bug An issue describing unexpected behavior of code label Dec 9, 2024
@github-project-automation github-project-automation bot moved this to Backlog in TFS 1.8 Dec 9, 2024
@nekiro nekiro added priority: high and removed priority: low Issues with this label won’t have the immediate focus labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing unexpected behavior of code priority: high
Projects
Status: Backlog
Development

No branches or pull requests

4 participants