From b4f61b9eb178afc6c03f8504e38ec84d210d1de2 Mon Sep 17 00:00:00 2001 From: endernon Date: Wed, 1 Jan 2025 14:21:10 +0000 Subject: [PATCH] remove powderlimit field entirely and make it automatically find based on num of powders (it's useless anyway) --- config.json | 1 - src/main.rs | 4 ++-- src/structures/mod.rs | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/config.json b/config.json index ccc5e6b..8b9c341 100644 --- a/config.json +++ b/config.json @@ -19,7 +19,6 @@ {"id": "rawSpellDamage", "base":222 , "roll":130 }, {"id": "spellDamage", "base":10 , "roll":130 } ], - "powder_limit": 10, "powders": [ {"type":"E", "tier":6}, {"type":"T", "tier":6}, diff --git a/src/main.rs b/src/main.rs index ddddba3..b0f4a54 100644 --- a/src/main.rs +++ b/src/main.rs @@ -215,13 +215,13 @@ fn cook( dbg!(&powdervec); } - let real_powderlimit = json_config.powder_limit.ok_or(PowderLimitNotPresent)?; + let powderlimitfr: u8 = powdervec.len() as u8; // ENCODE: PowderData // only occurs if the powders array is present and the powder limit is also present // PowderData { - powder_slots: real_powderlimit, + powder_slots: powderlimitfr, powders: powdervec, } .encode(ver, out) diff --git a/src/structures/mod.rs b/src/structures/mod.rs index 84d19cc..67b4f12 100644 --- a/src/structures/mod.rs +++ b/src/structures/mod.rs @@ -20,7 +20,6 @@ pub struct Jsonconfig { pub name: Option, pub shiny: Option, pub ids: Option>, - pub powder_limit: Option, pub powders: Option>, pub rerolls: Option, }