diff options
Diffstat (limited to 'server/bot')
-rw-r--r-- | server/bot/src/algos/customer.rs | 21 |
1 files changed, 10 insertions, 11 deletions
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() }; } |