feat(scripting/lua): add getnparams to client debug sandbox #3016
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.
Goal of this PR
Add additional functionality to the new client sandboxed lua debug lib as much of its functionality was removed.
How is this PR achieving the goal
Added the
debug.getnparams()
function to be used on the client. This is a bypass for the unsafe debug.getlocal(), so devs can still get the parameter names of a function passed as the argument to the new function.New lua docs for the debug function
This PR applies to the following area(s)
ScRT: Lua
Successfully tested on
Unable to build fivem on my laptop but did test it on Windows 10, using a simple C++ script and lua script and the code compiled and ran as expected. Used the functions in the file
LuaDebug.cpp
as reference to ensure consistency.Game builds:
Platforms:
Checklist
Fixes issues
Addresses #3010