handle errors on sprite parsing

This commit is contained in:
2020-06-23 13:01:04 +01:00
parent 7773949a8e
commit 4d33a0a284
2 changed files with 13 additions and 7 deletions

View File

@@ -186,7 +186,10 @@ impl Game {
} else if segment.starts_with("TIL ") {
tiles.push(Tile::from(segment));
} else if segment.starts_with("SPR ") {
sprites.push(Sprite::from(segment));
let sprite = Sprite::from(segment);
if sprite.is_ok() {
sprites.push(sprite.unwrap());
}
} else if segment.starts_with("ITM ") {
items.push(Item::from(segment));
} else if segment.starts_with("DLG ") {