From 5a9d60feb47ab6c7281877e64d04e5f6e527e4c6 Mon Sep 17 00:00:00 2001 From: Marenga Date: Sun, 17 May 2026 14:47:19 +0200 Subject: [PATCH] Fix misc. parsing issues in the fortress --- src/gamestate/mod.rs | 8 ++++++++ src/gamestate/social.rs | 9 ++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/gamestate/mod.rs b/src/gamestate/mod.rs index 2a260f8..3ed202a 100644 --- a/src/gamestate/mod.rs +++ b/src/gamestate/mod.rs @@ -733,6 +733,14 @@ impl GameState { )?; } "soldieradvice" => { + let advice: u16 = val.into("soldier advice")?; + if advice > 0 { + other_player + .get_or_insert_default() + .fortress + .get_or_insert_default() + .soldier_advice = advice; + } // Replaced } "owngroupdescription" => self diff --git a/src/gamestate/social.rs b/src/gamestate/social.rs index 1bc1ec4..f6fa104 100644 --- a/src/gamestate/social.rs +++ b/src/gamestate/social.rs @@ -434,6 +434,8 @@ pub struct OtherFortress { /// The amount of soldiers suggested to use when attacking this players /// fortress pub soldier_advice: u16, + /// The level of the fortifications of that player + pub fortifications_level: u16, /// The amount of stone we are expected to gain from raiding this players /// fortress pub lootable_wood: u64, @@ -479,9 +481,10 @@ impl OtherPlayer { ) -> Result<(), SFError> { let ft = self.fortress.get_or_insert_default(); ft.upgrade_count = data.csiget(0, "other ft upgrades", 0)?; - ft.soldier_advice = data.csiget(1, "other soldier advice", 0)?; - ft.mage_count = data.csiget(2, "other mage count", 0)?; - ft.archer_count = data.csiget(3, "other soldier advice", 0)?; + ft.fortifications_level = + data.csiget(1, "other soldier fortifications", 0)?; + ft.archer_count = data.csiget(2, "other mage count", 0)?; + ft.mage_count = data.csiget(3, "other soldier advice", 0)?; ft.lootable_wood = data.csiget(4, "other lootable wood", 0)?; ft.lootable_stone = data.csiget(5, "other lootable stone", 0)?; Ok(())