From 9a3f604b39b0c851aa799fc6651952e1ed8f030a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 25 Nov 2021 16:07:33 +0100 Subject: [PATCH] rom: Remove end of line chars from names ('@') MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- rom/build.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rom/build.rs b/rom/build.rs index bec76c6..c3ff807 100644 --- a/rom/build.rs +++ b/rom/build.rs @@ -79,6 +79,15 @@ fn get_pokemon_list(data: &[u8]) -> Result, Error> { // TODO: Ensure we have the right length? a multiple of 10 for (offset, ord) in data.iter().enumerate() { + if offset != 0 && (offset % 10) == 0 { + res.push(buffer.clone()); + buffer.clear() + } + + if *ord == 0x50 { // End char, '@'. + continue + } + let pkstr = match PKString::try_from(&[*ord][..]) { Ok(pkstr) => pkstr, Err(e) => { @@ -87,11 +96,6 @@ fn get_pokemon_list(data: &[u8]) -> Result, Error> { }, }; - if offset != 0 && (offset % 10) == 0 { - res.push(buffer.clone()); - buffer.clear() - } - buffer.push_str(String::from(&pkstr).as_str()); }