-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Change lua_pushnumber to lua_pushinteger for non floating point values #4523
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
base: master
Are you sure you want to change the base?
Conversation
|
Sorry missclicked |
|
needs a rebase |
|
@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 |
|
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. |
|
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. |
|
Hi guys, this seems to have been forgotten at some point, we could do a new analysis on these changes to merge into the main-code |
|
luaPlayerGetDeathPenalty is pushing player->getLostPercent() that is double but this function is not used in TFS scripts (getPlayerLossPercent and Player:getDeathPenalty() ) |
|
@ArturKnopik Yeah, this PR was made in 2023, we have to do a new analysis to see what should be done, it is important to highlight that in the Issue topic related to this PR, Nekiro reported some risks regarding these changes |
|
I'm gonna refresh this |
|
Im about to re-check it this weekend |
|
I made this change a long time ago in the TFS downgrade engine using lua5.4, and I can confirm everything is covered. We just need to fix the conflict, and it'll be ready for review/merge. |
Pull Request Prelude
Changes Proposed
Replace some
lua_pushnumberwithlua_pushintegerto 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:
setFieldLuaScriptInterface::registerVariableIssues addressed:
#4522