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