diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-20 16:56:00 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-20 16:56:00 +0200 |
commit | d720dabb780ba3c73a4656d8dc8fede721d6841d (patch) | |
tree | 67c218637959073385affbebe6a04bb5b4e913ee /server/src/game.rs | |
parent | c6733caa49e5b47c68c43b494c073ce7b34adec2 (diff) | |
download | hurrycurry-d720dabb780ba3c73a4656d8dc8fede721d6841d.tar hurrycurry-d720dabb780ba3c73a4656d8dc8fede721d6841d.tar.bz2 hurrycurry-d720dabb780ba3c73a4656d8dc8fede721d6841d.tar.zst |
correctly send lobby bool and send map name
Diffstat (limited to 'server/src/game.rs')
-rw-r--r-- | server/src/game.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/game.rs b/server/src/game.rs index f5670277..bb6d5182 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -135,6 +135,7 @@ impl Game { self.unload(); + self.lobby = gamedata.map_name == "lobby"; self.data = gamedata.into(); self.points = 0; self.end = timer.map(|dur| Instant::now() + dur); @@ -198,6 +199,7 @@ impl Game { tile_names: self.data.tile_names.clone(), tile_collide: self.data.tile_collide.clone(), tile_interact: self.data.tile_interact.clone(), + current_map: self.data.map_name.clone(), map_names: self .data .map @@ -584,7 +586,9 @@ impl Game { } pub fn count_chefs(&self) -> usize { - self.players.values().map(|p| if p.character >= 0 { 1 } else { 0 }) + self.players + .values() + .map(|p| if p.character >= 0 { 1 } else { 0 }) .sum() } } |