From 2693793aa92c17cfab1010b1e763ff768de9a06a Mon Sep 17 00:00:00 2001 From: "DESKTOP-45ANQ2C\\unis" <121212121@qq.com> Date: Sat, 12 Oct 2024 17:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A8=83=E5=A8=83=E6=9C=BA=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/clawdoll/player_clawdoll.go | 4 +++- gamesrv/clawdoll/scenepolicy_clawdoll.go | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gamesrv/clawdoll/player_clawdoll.go b/gamesrv/clawdoll/player_clawdoll.go index 0b82f75..b30445f 100644 --- a/gamesrv/clawdoll/player_clawdoll.go +++ b/gamesrv/clawdoll/player_clawdoll.go @@ -18,6 +18,7 @@ type PlayerEx struct { IsWin bool // 是否抓到娃娃 gainCoin int64 // 本局赢的金币 taxCoin int64 //本局税收 + lastIsWin bool // 上一局是否抓到娃娃 } func (this *PlayerEx) Clear(baseScore int32) { @@ -27,6 +28,7 @@ func (this *PlayerEx) Clear(baseScore int32) { this.gainCoin = 0 this.IsWin = false + this.lastIsWin = false } func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool { @@ -233,7 +235,7 @@ func (this *PlayerEx) SendPlayerGameBilled(RoundId int32) { if this != nil { result := 0 - if this.IsWin { + if this.lastIsWin { result = 1 } pack := &clawdoll.SCCLAWDOLLRoundGameBilled{ diff --git a/gamesrv/clawdoll/scenepolicy_clawdoll.go b/gamesrv/clawdoll/scenepolicy_clawdoll.go index 82e255f..f6b40fb 100644 --- a/gamesrv/clawdoll/scenepolicy_clawdoll.go +++ b/gamesrv/clawdoll/scenepolicy_clawdoll.go @@ -804,6 +804,7 @@ func (this *StateBilled) OnEnter(s *base.Scene) { sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) } + playerEx.lastIsWin = playerEx.IsWin playerEx.ReStartGame() } } @@ -933,6 +934,8 @@ func (this *StateWaitPayCoin) OnEnter(s *base.Scene) { playingEx := sceneEx.GetPlayingEx() if playingEx != nil { playingEx.SendPlayerGameBilled(int32(sceneEx.RoundId)) + + playingEx.lastIsWin = false } }