error handling for dialogues
This commit is contained in:
@@ -223,7 +223,13 @@ impl Game {
|
||||
} else if segment.starts_with("ITM ") {
|
||||
items.push(Item::from(segment));
|
||||
} else if segment.starts_with("DLG ") {
|
||||
dialogues.push(Dialogue::from(segment));
|
||||
let result = Dialogue::from_str(&segment);
|
||||
|
||||
if let Ok(dialogue) = result {
|
||||
dialogues.push(dialogue);
|
||||
} else {
|
||||
warnings.push(result.unwrap_err());
|
||||
}
|
||||
} else if segment.starts_with("END ") {
|
||||
let result = Ending::from_str(&segment);
|
||||
if let Ok(ending) = result {
|
||||
|
||||
Reference in New Issue
Block a user