diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-12-23 15:37:11 +0100 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-12-23 15:37:11 +0100 | 
| commit | 1a9f7e9a20bff0fbc854454f131d4bc546e73e72 (patch) | |
| tree | 7be16db47cd819177ae73d42af7b59c37593060a /server/src/entity | |
| parent | bd71cd120fa4d8caf4987fd9c76838ccbeec19f7 (diff) | |
| download | hurrycurry-1a9f7e9a20bff0fbc854454f131d4bc546e73e72.tar hurrycurry-1a9f7e9a20bff0fbc854454f131d4bc546e73e72.tar.bz2 hurrycurry-1a9f7e9a20bff0fbc854454f131d4bc546e73e72.tar.zst | |
two-handed server
Diffstat (limited to 'server/src/entity')
| -rw-r--r-- | server/src/entity/bot.rs | 3 | ||||
| -rw-r--r-- | server/src/entity/tutorial.rs | 4 | 
2 files changed, 4 insertions, 3 deletions
| diff --git a/server/src/entity/bot.rs b/server/src/entity/bot.rs index fe4d711f..368f8c9d 100644 --- a/server/src/entity/bot.rs +++ b/server/src/entity/bot.rs @@ -18,7 +18,7 @@  use super::{Entity, EntityContext};  use anyhow::Result;  use hurrycurry_bot::{BotAlgo, DynBotAlgo}; -use hurrycurry_protocol::{PacketS, PlayerClass, PlayerID}; +use hurrycurry_protocol::{Hand, PacketS, PlayerClass, PlayerID};  use log::info;  use rand::random;  use std::any::Any; @@ -72,6 +72,7 @@ impl<T: BotAlgo + Any> Entity for BotDriver<T> {              c.packet_in.push_back(PacketS::Interact {                  player: self.id,                  pos: input.interact, +                hand: Hand::Left,              })          }          c.packet_in.push_back(PacketS::Movement { diff --git a/server/src/entity/tutorial.rs b/server/src/entity/tutorial.rs index 44244862..33c0e507 100644 --- a/server/src/entity/tutorial.rs +++ b/server/src/entity/tutorial.rs @@ -144,7 +144,7 @@ impl StepContext<'_> {              .game              .players              .get(&self.player) -            .is_some_and(|p| p.item.as_ref().is_some_and(|i| i.kind == item)) +            .is_some_and(|p| p.items.iter().flatten().any(|i| i.kind == item))      }      pub fn find_demand(&self, item: ItemIndex) -> Option<IVec2> {          self.ent @@ -228,7 +228,7 @@ impl StepContext<'_> {              .game              .players              .get(&self.player) -            .is_some_and(|p| p.item.as_ref().is_some_and(|i| i.kind == item)) +            .is_some_and(|p| p.items.iter().flatten().any(|i| i.kind == item))          {              if let Some(pos) = self.find_demand(item) {                  Err((Some(pos), trm!("s.tutorial.serve"))) | 
