handle room endings
This commit is contained in:
parent
d25f7c1026
commit
6e9b91d845
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue