make everything &

This commit is contained in:
endernon 2025-01-04 00:49:55 +00:00
parent cd3261c9b4
commit d98f24812d
2 changed files with 12 additions and 12 deletions

View file

@ -56,7 +56,7 @@ pub fn encode_typedata_custom(
} }
pub fn encode_duradata( pub fn encode_duradata(
general_params: &mut FuncParams, general_params: &mut FuncParams,
real_dura: Durability, real_dura: &Durability,
) -> Result<(), Errorfr> { ) -> Result<(), Errorfr> {
let effect_strength_fr: u8; // but actually it should be 0 to 100, not 0 to 255. But i dunno how to use u7 data type. let effect_strength_fr: u8; // but actually it should be 0 to 100, not 0 to 255. But i dunno how to use u7 data type.
if let Some(effstr) = real_dura.effect_strength { if let Some(effstr) = real_dura.effect_strength {
@ -155,7 +155,7 @@ pub fn encode_namedata(general_params: &mut FuncParams, real_name: &str) {
} }
pub fn encode_iddata( pub fn encode_iddata(
general_params: &mut FuncParams, general_params: &mut FuncParams,
real_ids: Vec<Identificationer>, real_ids: &Vec<Identificationer>,
idsmap: HashMap<String, u8>, idsmap: HashMap<String, u8>,
) { ) {
let mut idvec = Vec::new(); let mut idvec = Vec::new();
@ -191,7 +191,7 @@ pub fn encode_iddata(
.encode(general_params.fr_ver, general_params.fr_out) .encode(general_params.fr_ver, general_params.fr_out)
.unwrap(); .unwrap();
} }
pub fn encode_powderdata(general_params: &mut FuncParams, real_powders: Vec<Powder>) { pub fn encode_powderdata(general_params: &mut FuncParams, real_powders: &Vec<Powder>) {
let mut powdervec = Vec::new(); let mut powdervec = Vec::new();
for eachpowder in real_powders { for eachpowder in real_powders {
let powderamount: u8 = eachpowder.amount.unwrap_or(1); let powderamount: u8 = eachpowder.amount.unwrap_or(1);
@ -240,8 +240,8 @@ pub fn encode_rerolldata(general_params: &mut FuncParams, rerollcount: u8) {
} }
pub fn encode_shinydata( pub fn encode_shinydata(
general_params: &mut FuncParams, general_params: &mut FuncParams,
shiny: Shinyjson, shiny: &Shinyjson,
json_shiny: Vec<Shinystruct>, json_shiny: &Vec<Shinystruct>,
) { ) {
let mut realshinykey: u8; let mut realshinykey: u8;
let _shinykey = &shiny.key; let _shinykey = &shiny.key;

View file

@ -132,7 +132,7 @@ fn cook(
// ENCODE: CustomGearTypeData / CustomConsumableTypeData // ENCODE: CustomGearTypeData / CustomConsumableTypeData
match json_config.item_type { match json_config.item_type {
ItemTypeDeser::CraftedGear | ItemTypeDeser::CraftedConsu => { ItemTypeDeser::CraftedGear | ItemTypeDeser::CraftedConsu => {
if let Some(real_crafted_type) = json_config.crafted_type { if let Some(real_crafted_type) = &json_config.crafted_type {
encode_typedata_custom(&mut fr_params, &real_crafted_type)?; encode_typedata_custom(&mut fr_params, &real_crafted_type)?;
} else { } else {
return Err(JsonNotFoundCraftedType); return Err(JsonNotFoundCraftedType);
@ -144,7 +144,7 @@ fn cook(
// ENCODE: NameData, if ItemType is Gear, Tome, Charm // ENCODE: NameData, if ItemType is Gear, Tome, Charm
match json_config.item_type { match json_config.item_type {
ItemTypeDeser::Gear | ItemTypeDeser::Tome | ItemTypeDeser::Charm => { ItemTypeDeser::Gear | ItemTypeDeser::Tome | ItemTypeDeser::Charm => {
if let Some(real_name) = json_config.name { if let Some(real_name) = &json_config.name {
encode_namedata(&mut fr_params, &real_name) encode_namedata(&mut fr_params, &real_name)
} else { } else {
return Err(Errorfr::JsonNotFoundName); return Err(Errorfr::JsonNotFoundName);
@ -156,7 +156,7 @@ fn cook(
// ENCODE: IdentificationData // ENCODE: IdentificationData
match json_config.item_type { match json_config.item_type {
ItemTypeDeser::Gear | ItemTypeDeser::Tome | ItemTypeDeser::Charm => { ItemTypeDeser::Gear | ItemTypeDeser::Tome | ItemTypeDeser::Charm => {
if let Some(real_ids) = json_config.ids { if let Some(real_ids) = &json_config.ids {
encode_iddata(&mut fr_params, real_ids, idsmap) encode_iddata(&mut fr_params, real_ids, idsmap)
} }
} }
@ -166,7 +166,7 @@ fn cook(
// ENCODE: DurabilityData (REQUIRED for CraftedGear) // ENCODE: DurabilityData (REQUIRED for CraftedGear)
match json_config.item_type { match json_config.item_type {
ItemTypeDeser::CraftedGear => { ItemTypeDeser::CraftedGear => {
if let Some(real_dura) = json_config.durability { if let Some(real_dura) = &json_config.durability {
encode_duradata(&mut fr_params, real_dura)?; encode_duradata(&mut fr_params, real_dura)?;
} else { } else {
return Err(Errorfr::JsonNotFoundDura); return Err(Errorfr::JsonNotFoundDura);
@ -190,7 +190,7 @@ fn cook(
// ENCODE: PowderData if ItemType is Gear, CraftedGear // ENCODE: PowderData if ItemType is Gear, CraftedGear
match json_config.item_type { match json_config.item_type {
ItemTypeDeser::Gear | ItemTypeDeser::CraftedGear => { ItemTypeDeser::Gear | ItemTypeDeser::CraftedGear => {
if let Some(real_powders) = json_config.powders { if let Some(real_powders) = &json_config.powders {
encode_powderdata(&mut fr_params, real_powders) encode_powderdata(&mut fr_params, real_powders)
} }
} }
@ -211,8 +211,8 @@ fn cook(
// ENCODE: ShinyData if ItemType is Gear // ENCODE: ShinyData if ItemType is Gear
match json_config.item_type { match json_config.item_type {
ItemTypeDeser::Gear => { ItemTypeDeser::Gear => {
if let Some(shiny) = json_config.shiny { if let Some(shiny) = &json_config.shiny {
encode_shinydata(&mut fr_params, shiny, json_shiny) encode_shinydata(&mut fr_params, shiny, &json_shiny)
} }
} }
_ => {} _ => {}