From f105af27bc5074e510ee0b41bdd63b5f094edc54 Mon Sep 17 00:00:00 2001 From: Marko Grizelj Date: Tue, 3 Sep 2024 09:36:23 +0200 Subject: [PATCH] chore: removed unnecessary step --- src/rand.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/rand.rs b/src/rand.rs index 01a7562..9582f0b 100644 --- a/src/rand.rs +++ b/src/rand.rs @@ -767,14 +767,7 @@ pub async fn read_objects(path: &PathBuf) -> anyhow::Result { )); } - let enemy_stats_index = stats_buf - .windows(16) - .position(|window| { - window == b"\x20\x00\x00\x00\x02\x00\x3a\x00\xDC\x00\x00\x00\x00\x00\x32\x00" - }) - .ok_or(anyhow::anyhow!("Can't find enemy stats beginning"))?; - - let mut enemy_stats_reader = Cursor::new(&stats_buf[enemy_stats_index..]); + let mut enemy_stats_reader = Cursor::new(&stats_buf); let mut enemy_stats_arr: Vec = Vec::new(); @@ -1043,7 +1036,7 @@ pub async fn read_objects(path: &PathBuf) -> anyhow::Result { let enemy_stats_object = ObjectArray { original: enemy_stats_arr, modified: enemy_stats_arr_copy, - index: enemy_stats_index, + index: 0, slen: 0x46, };