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

Change lua_pushnumber to lua_pushinteger for non floating point values #4523

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xmish
Copy link
Contributor

@xmish xmish commented Sep 1, 2023

Pull Request Prelude

Changes Proposed

Replace some lua_pushnumber with lua_pushinteger to fix display of some integer values in game.
I'm not sure if it's a valid approach and also I'm not sure about changes in:

  • setField
  • LuaScriptInterface::registerVariable

Issues addressed:
#4522

@ghost ghost requested review from a team September 2, 2023 02:28
@ranisalt ranisalt marked this pull request as ready for review September 2, 2023 23:03
@ranisalt ranisalt marked this pull request as draft September 2, 2023 23:03
@ranisalt
Copy link
Member

ranisalt commented Sep 2, 2023

Sorry missclicked

@EvilHero90
Copy link
Contributor

needs a rebase

@EvilHero90 EvilHero90 added enhancement Increase or improvement in quality, value, or extent decisions Debatable/disputable labels Jun 2, 2024
@EvilHero90 EvilHero90 added this to the 1.8 milestone Jun 2, 2024
@ranisalt
Copy link
Member

ranisalt commented Jun 2, 2024

@EvilHero90 we can't merge this right now because it implies dropping LuaJIT support, but we can do it for the next release cycle

@EvilHero90
Copy link
Contributor

@EvilHero90 we can't merge this right now because it implies dropping LuaJIT support, but we can do it for the next release cycle

There was no intention to push this immediatly, I just want to see if this gets worked on or not

@Codinablack
Copy link
Contributor

If this does get worked on, it is worth noting that "setField" uses "lua_pushNumber" and is probably actually needing to push a decimal in some places where that method is used, but also in many places it probably shouldn't. I believe that "setField" should be changed to "setIntField", "setFloatField" (yes I know it's actually a double), and "setStringField" or something along those lines, just to be on the safe side.

@Codinablack
Copy link
Contributor

I ended up using a metaprogramming approach with concepts and templates to create the additional setField overloads that are needed when making this sort of change, I recommend it highly over my previous recommendation to make new methods called setIntField, ect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decisions Debatable/disputable enhancement Increase or improvement in quality, value, or extent
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

4 participants