diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 1289826..082a406 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -26,8 +26,8 @@ impl Instance{ // LMAO look at this function! fn dom(lua:&mlua::Lua,mut f:impl FnMut(&mut WeakDom)->mlua::Result)->mlua::Result{ - let mut dom=lua.app_data_mut::<&'static mut WeakDom>().ok_or(mlua::Error::runtime("DataModel missing"))?; - f(&mut *dom) + let dom=*lua.app_data_mut::<*mut WeakDom>().ok_or(mlua::Error::runtime("DataModel missing"))?; + f(unsafe{&mut *dom}) } fn coerce_float(value:&mlua::Value)->Option{ diff --git a/src/runner/runner.rs b/src/runner/runner.rs index fc0fbb6..7c91a0a 100644 --- a/src/runner/runner.rs +++ b/src/runner/runner.rs @@ -79,13 +79,13 @@ impl Runner{ pub fn run_script(&self,script:crate::script::Script,context:&mut Context)->Result<(),Error>{ let yoink=script.name_source(context); //this makes set_app_data shut up about the lifetime - self.lua.set_app_data::<&'static mut rbx_dom_weak::WeakDom>(unsafe{core::mem::transmute(&mut context.dom)}); + self.lua.set_app_data::<*mut rbx_dom_weak::WeakDom>(&mut context.dom); let (name,source)=yoink.map_err(Error::Script)?; self.lua.globals().set("script",super::instance::Instance::from(script)).map_err(Error::Lua)?; self.lua.load(source) .set_name(name) .exec().map_err(Error::Lua)?; - self.lua.remove_app_data::<&'static mut rbx_dom_weak::WeakDom>(); + self.lua.remove_app_data::<*mut rbx_dom_weak::WeakDom>(); Ok(()) } }