summaryrefslogtreecommitdiff
path: root/server/src/state.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-25 19:40:02 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-25 19:40:15 +0200
commit97dd6a4508aed2764ab7662c14263adc09a2c553 (patch)
tree8ca16697beeebd6c7bfa808a14029f3a6ec655ec /server/src/state.rs
parent5edf5a9aaed90fbf5b80cb14c4a61b9b5a6ccec8 (diff)
downloadhurrycurry-97dd6a4508aed2764ab7662c14263adc09a2c553.tar
hurrycurry-97dd6a4508aed2764ab7662c14263adc09a2c553.tar.bz2
hurrycurry-97dd6a4508aed2764ab7662c14263adc09a2c553.tar.zst
abort game if no *chefs* are left.
Diffstat (limited to 'server/src/state.rs')
-rw-r--r--server/src/state.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/src/state.rs b/server/src/state.rs
index 11c45933..97261fab 100644
--- a/server/src/state.rs
+++ b/server/src/state.rs
@@ -130,7 +130,8 @@ impl State {
}
self.game
.packet_in(player, packet, &mut replies, &mut self.packet_out)?;
- if self.game.players.is_empty() && !self.game.lobby {
+
+ if self.game.count_chefs() <= 0 && !self.game.lobby {
self.tx
.send(PacketC::ServerMessage {
text: "Game was aborted automatically due to a lack of players".to_string(),