error handling for position
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::{from_base36, optional_data_line, AnimationFrames, Image, Position, ToBase36};
|
||||
use crate::image::animation_frames_from_string;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub struct Sprite {
|
||||
@@ -82,7 +83,7 @@ impl From<String> for Sprite {
|
||||
panic!("Bad room/position for sprite: {}", string);
|
||||
}
|
||||
|
||||
position = Some(Position::from(room_position[1].to_string()).unwrap());
|
||||
position = Some(Position::from_str(room_position[1]).unwrap());
|
||||
} else if last_line.starts_with("COL") {
|
||||
colour_id = Some(last_line.replace("COL ", "").parse().unwrap());
|
||||
} else if last_line.starts_with("ITM") {
|
||||
|
||||
Reference in New Issue
Block a user