diff --git a/Cargo.lock b/Cargo.lock index 3cb3bf2..c7ae28f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -571,9 +571,9 @@ dependencies = [ [[package]] name = "roblox_emulator" -version = "0.3.0" +version = "0.3.1" source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/" -checksum = "ba81a9134bb07930669340c7aad34719e74690f68771c6ef7b093f00ddba9e65" +checksum = "b58d7bb42d458984e629a012757474710fd0e429c2c824a2529574be5e7c2fd6" dependencies = [ "glam", "mlua", diff --git a/Cargo.toml b/Cargo.toml index e24f4f6..f1914cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,5 +18,5 @@ rbx_dom_weak = { version = "2.7.0", registry = "strafesnet" } rbx_mesh = "0.1.2" rbx_reflection_database = { version = "0.2.10", registry = "strafesnet" } rbx_xml = { version = "0.13.3", registry = "strafesnet" } -roblox_emulator = { version = "0.3.0", registry = "strafesnet" } +roblox_emulator = { version = "0.3.1", registry = "strafesnet" } strafesnet_common = { version = "0.5.1", registry = "strafesnet" } diff --git a/src/lib.rs b/src/lib.rs index 8cab9fd..0fec914 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,9 +24,9 @@ impl Model{ fn new(dom:WeakDom)->Self{ Self{dom} } - pub fn into_place(self)->(Place,roblox_emulator::place::Services){ + pub fn into_place(self)->Place{ let (dom,services)=roblox_emulator::place::new_place_with_instances_in_workspace(self.dom); - (Place{dom},services) + Place{dom,services} } } impl AsRef for Model{ @@ -37,11 +37,13 @@ impl AsRef for Model{ pub struct Place{ dom:WeakDom, + services:roblox_emulator::place::Services, } impl Place{ - pub fn run_scripts(&mut self,services:roblox_emulator::place::Services){ + pub fn run_scripts(&mut self){ + let Place{dom,services}=self; let runner=roblox_emulator::runner::Runner::new().unwrap(); - let context=roblox_emulator::context::Context::from_mut(&mut self.dom); + let context=roblox_emulator::context::Context::from_mut(dom); let scripts=context.scripts(); let runnable=runner.runnable_context(context,services).unwrap(); for script in scripts{