Skip to content
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

Fix bug in Rhai Event Handler #76

Merged
merged 8 commits into from
Oct 8, 2023
Merged

Fix bug in Rhai Event Handler #76

merged 8 commits into from
Oct 8, 2023

Conversation

zwazel
Copy link
Contributor

@zwazel zwazel commented Oct 6, 2023

This should fix #75

Also added a new example for Rhai.

@zwazel
Copy link
Contributor Author

zwazel commented Oct 6, 2023

I just noticed that i also updated the Rhai version. please tell me if I should revert this change or not.

@zwazel
Copy link
Contributor Author

zwazel commented Oct 6, 2023

I also just changed it so that i no longer get errors printed out when a function can't be found in a script.

as far as i can tell, this is a similar behaviour as in the Lua solution:

let f: Function = match globals.raw_get(event.hook_name.clone()) {
Ok(f) => f,
Err(_) => continue, // not subscribed to this event
};

@makspll
Copy link
Owner

makspll commented Oct 7, 2023

Hi @zwazel PR looks good, great catch! Love the examples. Please see to the clippy errors and LGTM

@zwazel
Copy link
Contributor Author

zwazel commented Oct 7, 2023

Glad I can help with this great crate!
I currently can't go on my PC, so i'll fix the clippy errros tomorrow!

I might also take a Look at how to tackle #75

Just saw your comment on it, will Look at it later. On mobile right now.

@makspll
Copy link
Owner

makspll commented Oct 7, 2023

Appreciate it a lot! no problem!

makspll
makspll previously approved these changes Oct 8, 2023
@zwazel
Copy link
Contributor Author

zwazel commented Oct 8, 2023

Hi, as far as I can tell the only clippy warning that I got was from lua derive.
(I actually didnt get any locally, so kinda hard to reproduce, but that should have fixed it)

@makspll
Copy link
Owner

makspll commented Oct 8, 2023

Yeah sorry about that, the CI runs on latest rust version meaning any new clippy warnings randomly popup on old code, I need to find a way to pick the clippy version somehow

@makspll makspll merged commit 346874f into makspll:main Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rhai Events are overriding each other
2 participants