strafe-client: print error report
This commit is contained in:
@@ -98,10 +98,15 @@ pub fn load<P:AsRef<std::path::Path>>(path:P)->Result<LoadFormat,LoadError>{
|
|||||||
#[cfg(feature="roblox")]
|
#[cfg(feature="roblox")]
|
||||||
ReadFormat::Roblox(model)=>{
|
ReadFormat::Roblox(model)=>{
|
||||||
let mut place=strafesnet_rbx_loader::Place::from(model);
|
let mut place=strafesnet_rbx_loader::Place::from(model);
|
||||||
place.run_scripts();
|
let script_errors=place.run_scripts().unwrap();
|
||||||
Ok(LoadFormat::Map(
|
for error in script_errors{
|
||||||
place.to_snf(LoadFailureMode::DefaultToNone).map_err(LoadError::LoadRoblox)?
|
println!("Script error: {error}");
|
||||||
))
|
}
|
||||||
|
let (map,errors)=place.to_snf(LoadFailureMode::DefaultToNone).map_err(LoadError::LoadRoblox)?;
|
||||||
|
if errors.count()!=0{
|
||||||
|
print!("Errors encountered while loading the map:\n{}",errors);
|
||||||
|
}
|
||||||
|
Ok(LoadFormat::Map(map))
|
||||||
},
|
},
|
||||||
#[cfg(feature="source")]
|
#[cfg(feature="source")]
|
||||||
ReadFormat::Source(bsp)=>Ok(LoadFormat::Map(
|
ReadFormat::Source(bsp)=>Ok(LoadFormat::Map(
|
||||||
|
|||||||
Reference in New Issue
Block a user