-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply LUA api providers before loading script. #98
Conversation
Fixes issue where api is not available during script initialization.
Found what is causing the NIL error. It happened upon fetching the bevy "world" from globals. It is not set on script load execution, only after event execution is fired. This makes it so that any API function which accesses world state cannot be used during script load. To fix this requires a refactor involving changing the |
Update: the other issues have their own concerns that should be in another PR. But the api registration issue is solved by this PR and should be considered Complete. I will open a different PR for potential api refactoring for connecting callback functions with event signals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one small nit
`providers.attach_all()' requires a mutex as it's argument. Also get_mut is describes as follows: Since this call borrows the Mutex mutably, no actual locking needs to take place -- the mutable borrow statically guarantees no locks exist. |
Sounds good, let's just fix CI and happy to merge (rustfmt not aarch64, that should fail) |
It worked it looks like... but then failed to cache? |
Fixes issue where api is not available during script initialization. #97
PR is not yet complete. There is still a
callback error
caused by: error converting Lua nil to userdata to investigate which happens when the api function is called.