Open Dr-zzt opened 1 year ago
I did some more experiment, and it's actually seemingly not related to function pointers. This is a smaller example:
main.eps
:
import b;
var problem = 0;
function onPluginStart()
{
py_print("Hello!");
}
b.eps
:
import main;
function troublemaker()
{
main.problem = 1;
return 0;
}
var trouble = troublemaker();
Works fine until 0.9.8.13, doesn't compile in 0.9.9.0 or later.
It's not just EUDFuncPtr
but applying to every epScript globals:
https://github.com/armoha/euddraft/blob/master/CHANGELOG.md#bugfix-7
Bugfix
- [epScript] Don't wrap global consants with ExprProxy unless there's forward-declared function call.
- No need to write
globalConst.getValue()
in most cases.Improved
- [epScript] Don't add initialization trigger for global variables when their initial values are constants
var trouble = 1; // since euddraft 0.9.9.0, this does not execute any trigger on game start
// before 0.9.9.0, this runs/wastes trigger to assign 1 on game start
// in euddraft 0.9.9.0, above code is rewrite into this:
const troubleRewrite = EUDVariable(1);
// works similar to `static var`
This is a minimal working example:
main.eps
:b.eps
:This code works fine until 0.9.8.13, but won't compile in 0.9.9.0 or later, due to circular import. My guess is that EUD function pointer content evaluation was lazy before but for some reason it's eager now.