From 7c178092d3c3f7538e7abe3a4f3dc51250f34077 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sun, 1 Feb 2026 20:22:27 +0800 Subject: [PATCH] Fix bug --- src/scripts/favorite/hcb.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/scripts/favorite/hcb.rs b/src/scripts/favorite/hcb.rs index f4ce630..2310028 100644 --- a/src/scripts/favorite/hcb.rs +++ b/src/scripts/favorite/hcb.rs @@ -1,6 +1,4 @@ //! Favorite HCB script (.hcb) -use std::io::Write; - use super::disasm::*; use crate::ext::io::*; use crate::scripts::base::*; @@ -8,6 +6,7 @@ use crate::types::*; use crate::utils::encoding::*; use crate::utils::str::*; use anyhow::Result; +use std::io::Write; #[derive(Debug)] /// Favorite HCB script builder @@ -255,7 +254,6 @@ impl Script for HcbScript { loop { let toper = &self.data.main_script[func_index]; new_funcs.push(toper.clone()); - func_index += 1; if matches!(toper.opcode, 0x02 | 0x06 | 0x07) { need_pacth_addresses.push(toper.pos + 1); } @@ -281,6 +279,7 @@ impl Script for HcbScript { } } } + func_index += 1; // Copy until the next call opcode if toper.opcode == 0x02 { break;