diff --git a/src/main.rs b/src/main.rs index 4a0a142..4f11e93 100644 --- a/src/main.rs +++ b/src/main.rs @@ -858,7 +858,7 @@ async fn write_files(config:WriteConfig,mut context:DecompiledContext)->AResult< file.push("template"); assert!(file.set_extension("rbxlx")); let output=std::io::BufWriter::new(std::fs::File::create(file)?); - rbx_xml::to_writer_default(output,&context.dom,&[context.dom.root_ref()])?; + rbx_xml::to_writer_default(output,&context.dom,context.dom.root().children())?; } Ok(()) @@ -1469,7 +1469,7 @@ async fn compile(config:CompileConfig)->AResult<()>{ //add in scripts and models let mut folder=config.input_folder.clone(); folder.push("src"); - let mut stack:Vec=dom.get_by_ref(dom.root().children()[0]).unwrap().children().into_iter().map(|&referent|CompileStackInstruction::TraverseReferent(referent)).collect(); + let mut stack:Vec=dom.root().children().into_iter().map(|&referent|CompileStackInstruction::TraverseReferent(referent)).collect(); while let Some(instruction)=stack.pop(){ match instruction{ CompileStackInstruction::TraverseReferent(item_ref)=>{ @@ -1542,6 +1542,7 @@ async fn compile(config:CompileConfig)->AResult<()>{ output_place.push("place.rbxl"); } let output=std::io::BufWriter::new(std::fs::File::create(output_place)?); - rbx_binary::to_writer(output,&dom,&[dom.root_ref()])?; + //write inner objects + rbx_binary::to_writer(output,&dom,dom.root().children())?; Ok(()) }