From 4202883df21d59bd4c01024c271c3b42c5d74d47 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 1 Nov 2023 14:24:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/room.go | 11 ++--------- modules/entertainment/xxlPlat.go | 4 +++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index e92401be0..7694150d9 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -145,13 +145,6 @@ func (this *Room) AiOperator() { this.player2.Ps-- // 交换元素 szMap, oid1, oid2, bAddPs = this.chessboard.AiSwapGirde() - for _, v := range szMap { // - this.player2.Energy += v.CurEnergy - v.CurEnergy = this.player2.Energy - curScore += v.CurSocre - this.player2.Score += v.CurSocre - v.CurSocre = this.player2.Score - } if bAddPs { this.player2.Ps++ @@ -165,7 +158,7 @@ func (this *Room) AiOperator() { this.round++ } // 校验下次是不是消除 - if this.chessboard.CheckAndRefreshPlat() { + if !this.chessboard.CheckAndRefreshPlat() { this.chessboard.RedsetPlatData() szMap = append(szMap, &pb.MapData{ Data: this.chessboard.GetPalatData(), @@ -342,7 +335,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr } // 校验下次是不是消除 - if this.chessboard.CheckAndRefreshPlat() { + if !this.chessboard.CheckAndRefreshPlat() { this.chessboard.RedsetPlatData() szMap = append(szMap, &pb.MapData{ Data: this.chessboard.GetPalatData(), diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index edb827e4d..840a14087 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -525,7 +525,9 @@ func (this *MapData) SkillUp(color int32, skillid int32, value int32, bDrop bool CurSocre: skillScore, CurEnergy: skillEnergy, }) - szMap, _ = this.CheckMap(1, false) + if list, _ := this.CheckMap(color, false); len(list) > 0 { + szMap = append(szMap, list...) + } } } }