forked from StrafesNET/map-tool
panic lol
This commit is contained in:
parent
e0e8744bfd
commit
cad29af4bb
@ -270,7 +270,6 @@ enum Interactive{
|
|||||||
Passed,
|
Passed,
|
||||||
Blocked,
|
Blocked,
|
||||||
Flagged,
|
Flagged,
|
||||||
ReplaceFailed,
|
|
||||||
}
|
}
|
||||||
enum ScriptAction {
|
enum ScriptAction {
|
||||||
Pass,
|
Pass,
|
||||||
@ -387,8 +386,7 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
|
|||||||
println!("replaced source id={} location={}",replace_id,location);
|
println!("replaced source id={} location={}",replace_id,location);
|
||||||
replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone()));
|
replace_script.properties.insert("Source".to_string(), rbx_dom_weak::types::Variant::String(replace_source.clone()));
|
||||||
}else{
|
}else{
|
||||||
println!("failed to get replacement source id={} location={}",replace_id,location);
|
panic!("failed to get replacement source id={} location={}",replace_id,location);
|
||||||
fail_type=Interactive::ReplaceFailed;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScriptAction::Flag => {
|
ScriptAction::Flag => {
|
||||||
@ -403,13 +401,14 @@ fn interactive() -> Result<(), Box<dyn std::error::Error>>{
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
panic!("script source property is none!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut dest=match fail_type{
|
let mut dest=match fail_type{
|
||||||
Interactive::Passed => std::path::PathBuf::from("maps/processed"),//write map into maps/processed
|
Interactive::Passed => std::path::PathBuf::from("maps/processed"),//write map into maps/processed
|
||||||
Interactive::Blocked => std::path::PathBuf::from("maps/blocked"),//write map into maps/blocked
|
Interactive::Blocked => std::path::PathBuf::from("maps/blocked"),//write map into maps/blocked
|
||||||
Interactive::Flagged => std::path::PathBuf::from("maps/flagged"),//write map into maps/flagged
|
Interactive::Flagged => std::path::PathBuf::from("maps/flagged"),//write map into maps/flagged
|
||||||
Interactive::ReplaceFailed => continue,//do nothing, map is still unprocessed
|
|
||||||
};
|
};
|
||||||
dest.push(file_thing.file_name());
|
dest.push(file_thing.file_name());
|
||||||
std::fs::rename(file_thing.path(), dest)?;
|
std::fs::rename(file_thing.path(), dest)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user