From 2964f8f74efcb59ea35e6dce6f0cc08035e17a57 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 26 Sep 2024 23:03:14 +0200 Subject: fix #173 --- server/bot/src/algos/customer.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'server/bot') diff --git a/server/bot/src/algos/customer.rs b/server/bot/src/algos/customer.rs index 64ae726f..bab82056 100644 --- a/server/bot/src/algos/customer.rs +++ b/server/bot/src/algos/customer.rs @@ -246,6 +246,7 @@ impl BotAlgo for Customer { }); if let Some(pos) = demand_pos { info!("{me:?} -> eating"); + let points = game.data.demands[demand.0].points; *self = Customer::Eating { demand: *demand, table: pos, @@ -275,6 +276,11 @@ impl BotAlgo for Customer { pos: Some(pos), player: me, }, + PacketS::ApplyScore(Score { + demands_completed: 1, + points, + ..Default::default() + }), PacketS::Interact { pos: None, player: me, @@ -300,16 +306,6 @@ impl BotAlgo for Customer { let demand = &game.data.demands[demand.0]; *progress += dt / demand.duration; if *progress >= 1. { - let mut packets = Vec::new(); - packets.push(PacketS::ReplaceHand { - player: me, - item: demand.output, - }); - packets.push(PacketS::ApplyScore(Score { - demands_completed: 1, - points: demand.points, - ..Default::default() - })); info!("{me:?} -> finishing"); *self = Customer::Finishing { table: *table, @@ -317,7 +313,10 @@ impl BotAlgo for Customer { cooldown: 0.5, }; return BotInput { - extra: packets, + extra: vec![PacketS::ReplaceHand { + player: me, + item: demand.output, + }], ..Default::default() }; } -- cgit v1.2.3-70-g09d2