Fix OOP definitions to return vectors for listed APIs - #5075
Merged
FileEX merged 6 commits intoAug 15, 2026
Merged
Conversation
FileEX
reviewed
Jul 23, 2026
sbx320
requested changes
Jul 25, 2026
sbx320
left a comment
Member
There was a problem hiding this comment.
To avoid backwards incompatibility, this should use lua_ncallresult.
For example see https://github.com/multitheftauto/mtasa-blue/blob/master/Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp#L1054
Keep multi-assign float returns for backwards compatibility while single-result/property access still returns Vector2/Vector3.
Author
Thanks, applied. OOP getters now use lua_ncallresult so multi-assign still returns floats, while single/property access returns a vector. |
FileEX
reviewed
Aug 5, 2026
added 2 commits
August 7, 2026 22:35
Updated OOP methods across various classes to utilize ArgumentParser for handling vector returns. This change maintains backward compatibility by ensuring that multi-assign float returns are preserved while transitioning to a more robust argument parsing mechanism. Adjustments were made to methods related to GUI elements, objects, vehicles, and radar areas, ensuring consistent behavior in Lua interactions.
FileEX
approved these changes
Aug 14, 2026
FileEX
enabled auto-merge (squash)
August 14, 2026 01:15
Member
|
Wait until @sbx320 approves it. |
sbx320
approved these changes
Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wire OOP method/property getters (and matching Vector setters where needed) so the APIs listed in #1583 return
Vector2/Vector3instead of multiple floats.Procedural functions (e.g.
getObjectScale,guiGetPosition,getRadarAreaSize) are unchanged and still return floats.Examples:
Covered (client/server as applicable): RadarArea size, Object scale, Ped muzzle position, Light direction, Vehicle turret/respawn, Water vertex position, GUI position/size/nativeSize, TextItem position.
Skipped: server
getCameraMatrix(incomplete stub), server PointLight (does not exist).Motivation
Several OOP definitions incorrectly returned multiple floats (or were missing vector OOP wiring), so
:getX()/.xdid not match the expected vector OOP semantics.Fixes #1583.
Test plan
luadefscompile cleanly.:get*()/.*return Vector types; for GUI also verify.position/.sizeassign withVector2.Checklist