浏览代码

房间没人,直接解散

johnclot69 3 月之前
父节点
当前提交
7bab11a42a
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      DotNet/Hotfix/Scenes/Game/Room/HGHHComponentSystem.cs

+ 8 - 1
DotNet/Hotfix/Scenes/Game/Room/HGHHComponentSystem.cs

@@ -188,7 +188,14 @@ namespace ET.Server
                         }
                         break;
                 }
-
+                
+                // 没人直接解散
+                if (room.GetAllPlayers().Count <= 0)
+                {
+                    room.Dispose();
+                    return;
+                }
+                
                 self.Time++;
             }
         }