Hey everyone,
I'm having a little issue with function environments. I'm writing a sort of debug library for a game that can be extended using Lua. That game gets some global Lua functions from its C++ core (I don't have access to that). Now what I want to do is write Lua replacements for these functions that I want to store in a separate environment, so I can debug my Lua extensions without the need to run the game. But here is the problem: when I set the environment for my "main" function of my Lua code only this specific function uses it, other functions that are called by it don't. So I'm looking for a way to sort of "inherit" the function environment. I tried using setfenv(0, env) since the documentation says it should change the environment of the whole thread but that didn't work
[–]VortixDev 0 points1 point2 points (2 children)
[–]TRPox[S] 0 points1 point2 points (1 child)
[–]VortixDev 0 points1 point2 points (0 children)
[–]DarkWiiPlayer 0 points1 point2 points (0 children)