diff options
| author | metamuffin <metamuffin@disroot.org> | 2025-10-23 19:30:07 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2025-10-23 19:30:10 +0200 |
| commit | 1b1a31bb6d59ad7fc10f122a2763115ffd955c31 (patch) | |
| tree | b5ca693c9ad902c6cb31586812e64383e5863aeb /server/src/entity/mod.rs | |
| parent | a5f623ef1c415039a8fae4bacb9c0a5cc346619c (diff) | |
| download | hurrycurry-1b1a31bb6d59ad7fc10f122a2763115ffd955c31.tar hurrycurry-1b1a31bb6d59ad7fc10f122a2763115ffd955c31.tar.bz2 hurrycurry-1b1a31bb6d59ad7fc10f122a2763115ffd955c31.tar.zst | |
Recursive bot driver despawn in customers entity and added missing packet processing on entity deletion; fixes #488
Diffstat (limited to 'server/src/entity/mod.rs')
| -rw-r--r-- | server/src/entity/mod.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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<PacketC>>, 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> { |