diff --git a/src/main.rs b/src/main.rs index 37fd66d..f8eb1a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -735,7 +735,13 @@ fn room_from_string(string: String) -> Room { exits.insert(position, exit); } else if last_line.starts_with("END") { + let last_line = last_line.replace("END ", ""); + let ending_position: Vec<&str> = last_line.split(' ').collect(); + let ending= ending_position[0].to_string(); + let position = ending_position[1].to_string(); + let position = position_from_string(position); + endings.insert(position, ending); } else { lines.push(last_line); break; } @@ -748,7 +754,7 @@ fn room_from_string(string: String) -> Room { tiles: vec![], items, exits, - endings: Default::default() + endings } }