--- a/rust/hedgewars-server/src/handlers/inroom.rs Sat Jan 11 00:44:25 2020 +0300
+++ b/rust/hedgewars-server/src/handlers/inroom.rs Sat Jan 11 01:06:41 2020 +0300
@@ -259,18 +259,15 @@
response,
);
- match room.game_info {
- Some(ref info) if info.teams_in_game == 0 => {
- if let Some(result) = room_control.end_game() {
- super::common::get_end_game_result(
- room_control.server(),
- room_id,
- result,
- response,
- );
- }
+ if let Some(0) = room.teams_in_game() {
+ if let Some(result) = room_control.end_game() {
+ super::common::get_end_game_result(
+ room_control.server(),
+ room_id,
+ result,
+ response,
+ );
}
- _ => (),
}
}
Err(RemoveTeamError::NoTeam) => response.warn(NO_TEAM_TO_REMOVE),
@@ -461,10 +458,7 @@
);
}
- if let Some(GameInfo {
- teams_in_game: 0, ..
- }) = room.game_info
- {
+ if let Some(0) = room.teams_in_game() {
if let Some(result) = room_control.end_game() {
super::common::get_end_game_result(
room_control.server(),