diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-21 01:08:49 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-21 01:08:49 +0200 |
commit | cb9d58b50c76f8c4a4068830ecb93e9aed0cf008 (patch) | |
tree | b8ad62cb3d69f418dade27378ecf168dbc065fbb | |
parent | 8153645c68781a66a0d5ad14a6a6b3dcfb82dc8e (diff) | |
download | hurrycurry-2.0.0.tar hurrycurry-2.0.0.tar.bz2 hurrycurry-2.0.0.tar.zst |
better tutorial end condition, fix #147v2.0.0
-rw-r--r-- | server/src/entity/tutorial.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/server/src/entity/tutorial.rs b/server/src/entity/tutorial.rs index d33f14ea..66533119 100644 --- a/server/src/entity/tutorial.rs +++ b/server/src/entity/tutorial.rs @@ -199,8 +199,18 @@ impl<'a> StepContext<'a> { self.aquire_item(item)?; *self.had_aquired_target = true; } - if let Some(pos) = self.find_demand(item) { - Err((Some(pos), trm!("s.tutorial.serve"))) + if self + .ent + .game + .players + .get(&self.player) + .map_or(false, |p| p.item.as_ref().map_or(false, |i| i.kind == item)) + { + if let Some(pos) = self.find_demand(item) { + Err((Some(pos), trm!("s.tutorial.serve"))) + } else { + Ok(()) + } } else { Ok(()) } |