From 8ff90f53231ffc363cb51e76f7c66763b71aad86 Mon Sep 17 00:00:00 2001 From: UltiNaruto Date: Sat, 5 Oct 2024 17:22:21 +0200 Subject: [PATCH] Changed parsing item type for special fn in add_modify_obj_patches.rs --- src/add_modify_obj_patches.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/add_modify_obj_patches.rs b/src/add_modify_obj_patches.rs index 80528e43..e3b3d29e 100644 --- a/src/add_modify_obj_patches.rs +++ b/src/add_modify_obj_patches.rs @@ -616,9 +616,15 @@ pub fn patch_add_special_fn( let default_unknown0 = "".to_string(); let unknown0 = config.unknown1.as_ref().unwrap_or(&default_unknown0); let unknown0 = string_to_cstr(unknown0.clone()); - let default_item_id = "Power Beam".to_string(); - let item_id = config.item_id.as_ref().unwrap_or(&default_item_id); - let item_id = PickupType::from_str(&item_id[..]) as u32; + let pickup_type = match config.item_id.as_ref() { + Some(item_id) => { + PickupType::from_str(item_id) + }, + None => { + PickupType::PowerBeam + }, + }; + let item_id = pickup_type as u32; macro_rules! new { () => {