aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/customers/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-20 19:43:14 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-20 19:43:14 +0200
commitfebbc005cfac682257af0b74be5b307d4f23f91c (patch)
treea9884a873bd995b75c74583121e4bdd27c3fa5c2 /server/src/entity/customers/mod.rs
parent1a45b0e0f5de785ddf268d7371f0cdaeafe9daa7 (diff)
downloadhurrycurry-febbc005cfac682257af0b74be5b307d4f23f91c.tar
hurrycurry-febbc005cfac682257af0b74be5b307d4f23f91c.tar.bz2
hurrycurry-febbc005cfac682257af0b74be5b307d4f23f91c.tar.zst
send score menu on game end
Diffstat (limited to 'server/src/entity/customers/mod.rs')
-rw-r--r--server/src/entity/customers/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/entity/customers/mod.rs b/server/src/entity/customers/mod.rs
index e8679dc9..974ae686 100644
--- a/server/src/entity/customers/mod.rs
+++ b/server/src/entity/customers/mod.rs
@@ -22,7 +22,7 @@ use super::EntityT;
use crate::{data::Demand, game::Game};
use anyhow::{anyhow, Result};
use fake::{faker, Fake};
-use hurrycurry_protocol::{glam::IVec2, DemandIndex, Message, PacketS, PlayerID};
+use hurrycurry_protocol::{glam::IVec2, DemandIndex, Message, PacketC, PacketS, PlayerID};
use log::{info, warn};
use pathfinding::{find_path, Path};
use rand::{random, thread_rng};
@@ -74,7 +74,7 @@ impl Customers {
}
impl EntityT for Customers {
- fn tick(&mut self, game: &mut Game, dt: f32) -> Result<()> {
+ fn tick(&mut self, game: &mut Game, packet_out: &mut VecDeque<PacketC>, dt: f32) -> Result<()> {
self.spawn_cooldown -= dt;
self.spawn_cooldown = self.spawn_cooldown.max(0.);
if self.customers.len() < 5 && self.spawn_cooldown <= 0. {
@@ -253,7 +253,7 @@ impl EntityT for Customers {
self.customers.remove(&c).unwrap();
}
for (player, packet) in self.cpackets.drain(..) {
- if let Err(err) = game.packet_in(player, packet, &mut vec![]) {
+ if let Err(err) = game.packet_in(player, packet, &mut vec![], packet_out) {
warn!("demand packet {err}");
}
}