From 1b1a31bb6d59ad7fc10f122a2763115ffd955c31 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 23 Oct 2025 19:30:07 +0200 Subject: Recursive bot driver despawn in customers entity and added missing packet processing on entity deletion; fixes #488 --- server/src/entity/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'server/src/entity/mod.rs') diff --git a/server/src/entity/mod.rs b/server/src/entity/mod.rs index 2e235c95..2c46a017 100644 --- a/server/src/entity/mod.rs +++ b/server/src/entity/mod.rs @@ -64,6 +64,21 @@ pub struct EntityContext<'a> { pub replies: Option<&'a mut Vec>, pub dt: f32, } +impl EntityContext<'_> { + pub fn dup<'a>(&'a mut self) -> EntityContext<'a> { + EntityContext { + game: self.game, + serverdata: self.serverdata, + packet_out: self.packet_out, + packet_in: self.packet_in, + score_changed: self.score_changed, + dt: self.dt, + scoreboard: self.scoreboard, + load_map: self.load_map, + replies: None, + } + } +} pub trait Entity: Any { fn tick(&mut self, _c: EntityContext<'_>) -> Result<(), TrError> { -- cgit v1.3