From 3e985962c8dd6233157adf11e9a432753ac699bb Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Thu, 30 Apr 2020 21:48:51 +0100 Subject: [PATCH] special treatment of multi-line game name --- src/game.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/game.rs b/src/game.rs index e3e51a0..87da5a4 100644 --- a/src/game.rs +++ b/src/game.rs @@ -101,15 +101,20 @@ impl Game { let mut name = "".to_string(); if - ! segments[0].starts_with("# BITSY VERSION ") - && - ! segments[0].starts_with("! ROOM_FORMAT ") - && - ! segments[0].starts_with("PAL ") - && - ! segments[0].starts_with("DEFAULT_FONT ") - && - ! segments[0].starts_with("TEXT_DIRECTION ") { + segments[0].starts_with("\"\"\"") // multi-line game name + || + ( + ! segments[0].starts_with("# BITSY VERSION ") + && + ! segments[0].starts_with("! ROOM_FORMAT ") + && + ! segments[0].starts_with("PAL ") + && + ! segments[0].starts_with("DEFAULT_FONT ") + && + ! segments[0].starts_with("TEXT_DIRECTION ") + ) + { name = segments[0].to_string(); segments = segments[1..].to_owned(); }