be a bit more fussy about checking for segment names - game title "PALACE" was being parsed as a palette... :(

This commit is contained in:
Max Bradbury 2020-04-26 13:33:04 +01:00
parent cf1ca6f1b5
commit daa46e26ee
1 changed files with 18 additions and 15 deletions

View File

@ -95,7 +95,7 @@ impl Game {
} }
let string = string.trim_start_matches("\n").to_string(); let string = string.trim_start_matches("\n").to_string();
let segments = segments_from_string(string); let mut segments = segments_from_string(string);
let mut name = "".to_string(); let mut name = "".to_string();
@ -110,8 +110,11 @@ impl Game {
&& &&
! segments[0].starts_with("TEXT_DIRECTION ") { ! segments[0].starts_with("TEXT_DIRECTION ") {
name = segments[0].to_string(); name = segments[0].to_string();
segments = segments[1..].to_owned();
} }
let segments = segments;
let name = name; let name = name;
let mut dialogues: Vec<Dialogue> = Vec::new(); let mut dialogues: Vec<Dialogue> = Vec::new();
let mut endings: Vec<Ending> = Vec::new(); let mut endings: Vec<Ending> = Vec::new();