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

changing handle_events in the ScriptHost trait to be a mut method #72

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bevy_mod_scripting_core/src/hosts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub trait ScriptHost: Send + Sync + 'static + Default + Resource {
/// the main point of contact with the bevy world.
/// Scripts are called with appropriate events in the event order
fn handle_events<'a>(
&self,
&mut self,
world_ptr: &mut World,
events: &[Self::ScriptEvent],
ctxs: impl Iterator<Item = (ScriptData<'a>, &'a mut Self::ScriptContext)>,
Expand Down
2 changes: 1 addition & 1 deletion bevy_mod_scripting_core/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub fn script_event_handler<H: ScriptHost, const MAX: u32, const MIN: u32>(world

let mut ctxts: ScriptContexts<H::ScriptContext> = world.remove_resource().unwrap();

let host: H = world.remove_resource().unwrap();
let mut host: H = world.remove_resource().unwrap();
let mut providers: APIProviders<H> = world.remove_resource().unwrap();

// we need a resource scope to be able to simultaneously access the contexts as well
Expand Down
2 changes: 1 addition & 1 deletion languages/bevy_mod_scripting_lua/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl<A: LuaArg> ScriptHost for LuaScriptHost<A> {
}

fn handle_events<'a>(
&self,
&mut self,
world: &mut World,
events: &[Self::ScriptEvent],
ctxs: impl Iterator<Item = (ScriptData<'a>, &'a mut Self::ScriptContext)>,
Expand Down
2 changes: 1 addition & 1 deletion languages/bevy_mod_scripting_rhai/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<A: FuncArgs + Send + Clone + Sync + 'static> ScriptHost for RhaiScriptHost<
}

fn handle_events<'a>(
&self,
&mut self,
world: &mut World,
events: &[Self::ScriptEvent],
ctxs: impl Iterator<Item = (ScriptData<'a>, &'a mut Self::ScriptContext)>,
Expand Down
Loading