From 62d918e5feeaf5b3add982a5baaffb201a1f2ece Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 19 Oct 2025 00:38:09 +0200 Subject: Implement interaction with other players through id instead of tile pos --- server/src/entity/book.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/src/entity/book.rs') diff --git a/server/src/entity/book.rs b/server/src/entity/book.rs index 8daec972..e8456591 100644 --- a/server/src/entity/book.rs +++ b/server/src/entity/book.rs @@ -18,7 +18,7 @@ use super::{Entity, EntityContext}; use anyhow::Result; use hurrycurry_locale::TrError; -use hurrycurry_protocol::{Menu, PacketC, PlayerID, glam::IVec2}; +use hurrycurry_protocol::{ItemLocation, Menu, PacketC, PlayerID, glam::IVec2}; #[derive(Debug, Clone)] pub struct Book(pub IVec2); @@ -27,10 +27,10 @@ impl Entity for Book { fn interact( &mut self, c: EntityContext<'_>, - pos: Option, + pos: Option, _player: PlayerID, ) -> Result { - if pos == Some(self.0) { + if pos == Some(ItemLocation::Tile(self.0)) { if let Some(r) = c.replies { r.push(PacketC::Menu(Menu::Book(c.serverdata.book.clone()))); } -- cgit v1.3