I've run into a problem with asCContext::GetFunction(0), its return value doesn't change when execution is inside a global function, instead it just returns whatever the function was that called the global function. So if you call asGetActiveContext()->GetFunction(0) from inside the body of a global function the answer isn't very helpful!
This functionality is useful for an application that needs to associate additional data with a global function. In my case I'm proxying through to a method call on a class instance.
I ended up altering as_context.cpp at lines 2051 and 2201 to add this functionality, but my solution probably isn't perfect. Calls like this:
l_sp += CallSystemFunction(i, this, 0);
Get wrapped like this:
asCScriptFunction * previousCurrentFunction = currentFunction;
currentFunction = engine->scriptFunctions;
l_sp += CallSystemFunction(i, this, 0);
currentFunction = previousCurrentFunction;
Any chance of this change or something like it being included in the next point release?
Thanks,
Richard