|
@@ -67,14 +67,17 @@ func (room_info *RoomInfoWrapper) updateRoleStep(role_id string, step int32) {
|
|
|
// 是否结束游戏
|
|
|
func (room_info *RoomInfoWrapper) IsOverGame() bool {
|
|
|
colors := room_info.Colors
|
|
|
+ if len(colors) == 1 { //说明就剩下一个人了
|
|
|
+ return true
|
|
|
+ }
|
|
|
count := 0
|
|
|
- for i := 0; i < len(room_info.Colors); i++ {
|
|
|
- element := room_info.Colors[i]
|
|
|
+ for i := 0; i < len(colors); i++ {
|
|
|
+ element := colors[i]
|
|
|
if element.IsFinish || element.IsKick {
|
|
|
count++
|
|
|
}
|
|
|
}
|
|
|
- return count == len(colors)-1
|
|
|
+ return count == len(colors)
|
|
|
}
|
|
|
|
|
|
func (room_info *RoomInfoWrapper) getColors() []*msg.ColorData {
|