From ac682c7098a22e02f2a07ac6b159ea83b1a68616 Mon Sep 17 00:00:00 2001 From: Codie Newark Date: Tue, 12 Nov 2024 18:43:47 +0000 Subject: [PATCH] Fixed the limit for hopper and category names. --- .../s_blf_chunk_hopper_configuration_table.rs | 4 ++-- blf_lib/src/types/c_string.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blf_lib/src/blf/chunks/halo3/v12070_08_09_05_2031_halo3_ship/s_blf_chunk_hopper_configuration_table.rs b/blf_lib/src/blf/chunks/halo3/v12070_08_09_05_2031_halo3_ship/s_blf_chunk_hopper_configuration_table.rs index 4496904..5008a4b 100644 --- a/blf_lib/src/blf/chunks/halo3/v12070_08_09_05_2031_halo3_ship/s_blf_chunk_hopper_configuration_table.rs +++ b/blf_lib/src/blf/chunks/halo3/v12070_08_09_05_2031_halo3_ship/s_blf_chunk_hopper_configuration_table.rs @@ -13,12 +13,12 @@ use serde_hex::{SerHex,StrictCap}; pub struct s_game_hopper_custom_category { pub category_identifier: u16, pub category_image_index: u8, - pub category_name: StaticString<32>, + pub category_name: StaticString<15>, } #[derive(Clone, Default, PartialEq, Debug, Serialize, Deserialize)] pub struct c_hopper_configuration { - pub hopper_name: StaticString<32>, + pub hopper_name: StaticString<15>, pub game_set_hash: s_network_http_request_hash, pub hopper_identifier: u16, pub hopper_category: u16, diff --git a/blf_lib/src/types/c_string.rs b/blf_lib/src/types/c_string.rs index 05bef39..eb53c5d 100644 --- a/blf_lib/src/types/c_string.rs +++ b/blf_lib/src/types/c_string.rs @@ -143,7 +143,7 @@ impl StaticString { pub fn set_string(&mut self, value: &String) -> Result<(), String> { let bytes = value.as_bytes(); if bytes.len() > N { - return Err(format!("String too long ({} > {}) bytes", N, bytes.len())); + return Err(format!("String \"{value}\" too long ({} > {}) bytes", N, bytes.len())); } self.buf.fill(0); self.buf[..bytes.len()].copy_from_slice(bytes);