aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/portal.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/portal.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/portal.rs')
-rw-r--r--server/src/entity/portal.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/server/src/entity/portal.rs b/server/src/entity/portal.rs
index 2d4a762b..e0ec353f 100644
--- a/server/src/entity/portal.rs
+++ b/server/src/entity/portal.rs
@@ -1,3 +1,5 @@
+use std::collections::VecDeque;
+
/*
Hurry Curry! - a game about cooking
Copyright 2024 metamuffin
@@ -18,7 +20,7 @@
use super::EntityT;
use crate::game::{interact_effect, Game};
use anyhow::{anyhow, Result};
-use hurrycurry_protocol::{glam::IVec2, ItemLocation};
+use hurrycurry_protocol::{glam::IVec2, ItemLocation, PacketC};
#[derive(Debug, Default, Clone)]
pub struct Portal {
@@ -27,7 +29,12 @@ pub struct Portal {
}
impl EntityT for Portal {
- 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<()> {
let [from, to] = game
.tiles
.get_many_mut([&self.from, &self.to])
@@ -42,7 +49,7 @@ impl EntityT for Portal {
&mut from.item,
ItemLocation::Tile(self.from),
Some(to.kind),
- &mut game.packet_out,
+ packet_out,
&mut game.score,
true,
);