From 43ab764b18a99602557a3d27aab903b1d03c085e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 17 Oct 2024 11:33:20 -0700 Subject: [PATCH] wip runservice --- src/runner/instance.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runner/instance.rs b/src/runner/instance.rs index 88ebc7b..59b697d 100644 --- a/src/runner/instance.rs +++ b/src/runner/instance.rs @@ -369,12 +369,13 @@ static CLASS_FUNCTION_DATABASE:CFD=phf::phf_map!{ "GetService"=>cf!(|lua,_this,service:mlua::String|{ dom_mut(lua,|dom|{ //dom.root_ref()==this.referent ? - match &*service.to_str()?{ - "Lighting"=>{ - let referent=find_first_child_of_class(dom,dom.root(),"Lighting") + let service=&*service.to_str()?; + match service{ + "Lighting"|"RunService"=>{ + let referent=find_first_child_of_class(dom,dom.root(),service) .map(|instance|instance.referent()) .unwrap_or_else(|| - dom.insert(dom.root_ref(),InstanceBuilder::new("Lighting")) + dom.insert(dom.root_ref(),InstanceBuilder::new(service)) ); Ok(Instance::new(referent)) },