diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-30 11:33:03 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-30 11:33:03 +0100 |
| commit | aee4e6229b6a796691ba7a5bfff4e2b76700662a (patch) | |
| tree | 3e4b76e2d07936c2e39f227edd92a8a986b814e8 | |
| parent | a85f6200517405918941cc64ba4b734e246bc411 (diff) | |
| download | hurrycurry-aee4e6229b6a796691ba7a5bfff4e2b76700662a.tar hurrycurry-aee4e6229b6a796691ba7a5bfff4e2b76700662a.tar.bz2 hurrycurry-aee4e6229b6a796691ba7a5bfff4e2b76700662a.tar.zst | |
clippy
| -rw-r--r-- | server/bot/src/algos/frank.rs | 2 | ||||
| -rw-r--r-- | server/bot/src/step.rs | 22 | ||||
| -rw-r--r-- | server/locale/src/lib.rs | 4 | ||||
| -rw-r--r-- | server/src/entity/customers.rs | 2 | ||||
| -rw-r--r-- | server/src/main.rs | 2 |
5 files changed, 12 insertions, 20 deletions
diff --git a/server/bot/src/algos/frank.rs b/server/bot/src/algos/frank.rs index a02b0112..8bd6d17b 100644 --- a/server/bot/src/algos/frank.rs +++ b/server/bot/src/algos/frank.rs @@ -92,7 +92,6 @@ impl BotAlgo for Frank { timeout: Some(3.), pin: Some(false), }); - return; } } else { out.push(PacketS::Movement { @@ -101,7 +100,6 @@ impl BotAlgo for Frank { boost: false, pos: None, }); - return; } } else if let Some(path) = find_path_to_neighbour(game, pos.as_ivec2(), tpos.as_ivec2()) diff --git a/server/bot/src/step.rs b/server/bot/src/step.rs index 8f103cff..6031439f 100644 --- a/server/bot/src/step.rs +++ b/server/bot/src/step.rs @@ -121,19 +121,15 @@ impl StepState { boost: false, pos: None, }); - } else { - if self.wait_timer > 0. { - self.wait_timer -= dt; - } else { - if self.interact_stop_pending { - self.interact_stop_pending = false; - out.push(PacketS::Interact { - player: self.me, - hand: self.hand, - target: None, - }); - } - } + } else if self.wait_timer > 0. { + self.wait_timer -= dt; + } else if self.interact_stop_pending { + self.interact_stop_pending = false; + out.push(PacketS::Interact { + player: self.me, + hand: self.hand, + target: None, + }); } } else { self.item_current = game diff --git a/server/locale/src/lib.rs b/server/locale/src/lib.rs index 0bf4bf80..af1c19fc 100644 --- a/server/locale/src/lib.rs +++ b/server/locale/src/lib.rs @@ -46,9 +46,7 @@ impl Locale { // } pub fn merge(&mut self, other: Self) { for (k, v) in other.0 { - if !self.0.contains_key(&k) { - self.0.insert(k, v); - } + self.0.entry(k).or_insert(v); } } pub fn load(path: &Path) -> Result<Self> { diff --git a/server/src/entity/customers.rs b/server/src/entity/customers.rs index 193fc2a3..148faf81 100644 --- a/server/src/entity/customers.rs +++ b/server/src/entity/customers.rs @@ -64,7 +64,7 @@ impl Entity for Customers { headwear: 0, }, PlayerClass::Customer, - |id| Customer::new(id), + Customer::new, ); self.customers.push(bot) } diff --git a/server/src/main.rs b/server/src/main.rs index b1086b39..8a080af6 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -265,7 +265,7 @@ async fn run(data_path: PathBuf, args: Args) -> anyhow::Result<()> { } }; } - let _ = state.write().await.disconnect(id); + state.write().await.disconnect(id); }); } Ok(()) |