测试优化

This commit is contained in:
meixiongfeng 2023-11-01 14:24:32 +08:00
parent d675f2099e
commit 4202883df2
2 changed files with 5 additions and 10 deletions

View File

@ -145,13 +145,6 @@ func (this *Room) AiOperator() {
this.player2.Ps-- this.player2.Ps--
// 交换元素 // 交换元素
szMap, oid1, oid2, bAddPs = this.chessboard.AiSwapGirde() 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 { if bAddPs {
this.player2.Ps++ this.player2.Ps++
@ -165,7 +158,7 @@ func (this *Room) AiOperator() {
this.round++ this.round++
} }
// 校验下次是不是消除 // 校验下次是不是消除
if this.chessboard.CheckAndRefreshPlat() { if !this.chessboard.CheckAndRefreshPlat() {
this.chessboard.RedsetPlatData() this.chessboard.RedsetPlatData()
szMap = append(szMap, &pb.MapData{ szMap = append(szMap, &pb.MapData{
Data: this.chessboard.GetPalatData(), 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() this.chessboard.RedsetPlatData()
szMap = append(szMap, &pb.MapData{ szMap = append(szMap, &pb.MapData{
Data: this.chessboard.GetPalatData(), Data: this.chessboard.GetPalatData(),

View File

@ -525,7 +525,9 @@ func (this *MapData) SkillUp(color int32, skillid int32, value int32, bDrop bool
CurSocre: skillScore, CurSocre: skillScore,
CurEnergy: skillEnergy, CurEnergy: skillEnergy,
}) })
szMap, _ = this.CheckMap(1, false) if list, _ := this.CheckMap(color, false); len(list) > 0 {
szMap = append(szMap, list...)
}
} }
} }
} }