diff options
author | metamuffin <metamuffin@disroot.org> | 2024-12-25 19:37:20 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-12-25 19:37:20 +0100 |
commit | bd74a4e0c0e4e42717c2931eab3febfae219ac9c (patch) | |
tree | 30d6dc91921aab9a8ffd271901d8122891560a65 /server/bot/src/algos/customer.rs | |
parent | 462bc5a62f24a35e05d6a171566495e2641583a8 (diff) | |
download | hurrycurry-bd74a4e0c0e4e42717c2931eab3febfae219ac9c.tar hurrycurry-bd74a4e0c0e4e42717c2931eab3febfae219ac9c.tar.bz2 hurrycurry-bd74a4e0c0e4e42717c2931eab3febfae219ac9c.tar.zst |
variable hand count
Diffstat (limited to 'server/bot/src/algos/customer.rs')
-rw-r--r-- | server/bot/src/algos/customer.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs index 826ab534..b0ece9dd 100644 --- a/server/bot/src/algos/customer.rs +++ b/server/bot/src/algos/customer.rs @@ -313,7 +313,7 @@ impl CustomerState { PacketS::Interact { pos: Some(pos), player: me, - hand: Hand::Left, + hand: Hand(0), }, PacketS::ApplyScore(Score { demands_completed: 1, @@ -323,7 +323,7 @@ impl CustomerState { PacketS::Interact { pos: None, player: me, - hand: Hand::Left, + hand: Hand(0), }, ], ..Default::default() @@ -356,7 +356,7 @@ impl CustomerState { extra: vec![PacketS::ReplaceHand { player: me, item: demand.output, - hand: Hand::Left, + hand: Hand(0), }], ..Default::default() }; @@ -375,7 +375,8 @@ impl CustomerState { if game .players .get(&me) - .is_some_and(|pl| pl.items[Hand::Left.index()].is_none()) + .is_some_and(|pl| pl.items[0].is_none()) + // TODO index out of bounds? { if let Some(path) = find_path(&game.walkable, pos.as_ivec2(), *origin) { *self = CustomerState::Exiting { path }; @@ -390,12 +391,12 @@ impl CustomerState { PacketS::Interact { player: me, pos: Some(*table), - hand: Hand::Left, + hand: Hand(0), }, PacketS::Interact { player: me, pos: None, - hand: Hand::Left, + hand: Hand(0), }, ], direction, |