diff --git a/src/encode.rs b/src/encode.rs index 1dd3ebc..f7fb769 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -62,7 +62,7 @@ pub fn encode_duradata(general_params: &mut FuncParams, real_dura: Durability) - // new range is 50-10 = 40 let new_range = 40; // NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin - effect_strength_fr = ((((current_percentage - 0) * new_range) / old_range) + 10) as u8 + effect_strength_fr = ((((current_percentage) * new_range) / old_range) + 10) as u8 } else { return Err(Errorfr::JsonDuraOutOfRange) diff --git a/src/main.rs b/src/main.rs index 7055358..c1a2fd1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -129,7 +129,7 @@ fn cook( match json_config.item_type { ItemTypeDeser::CraftedGear | ItemTypeDeser::CraftedConsu => { if let Some(real_crafted_type) = json_config.crafted_type { - return encode_typedata_custom(&mut fr_params, &*real_crafted_type); + return encode_typedata_custom(&mut fr_params, &real_crafted_type); } else { return Err(JsonNotFoundCraftedType)