rust/hedgewars-server/src/handlers/inroom.rs
changeset 15541 d122b65bdf6f
parent 15540 479911540e17
child 15548 e1c2ca38e511
--- 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(),