fix 余额不足,踢出房间
This commit is contained in:
parent
62b256a26e
commit
48baba7a03
|
@ -733,6 +733,7 @@ func (this *SceneBaseStateTienLen) OnPlayerOp(s *base.Scene, p *base.Player, opc
|
|||
}
|
||||
// 扣房费
|
||||
// 房主扣费
|
||||
afterCoin := p.GetCoin()
|
||||
if (sceneEx.GetCustom().GetCostType() == 2 && playerEx.SnId == sceneEx.GetCreator()) ||
|
||||
sceneEx.GetCustom().GetCostType() == 1 {
|
||||
var item []*model.Item
|
||||
|
@ -751,9 +752,13 @@ func (this *SceneBaseStateTienLen) OnPlayerOp(s *base.Scene, p *base.Player, opc
|
|||
break
|
||||
}
|
||||
}
|
||||
|
||||
if v.GetId() == 100001 {
|
||||
afterCoin -= v.GetNum()
|
||||
}
|
||||
}
|
||||
// 检查余额
|
||||
if less {
|
||||
if less || afterCoin <= 0 {
|
||||
sceneEx.PlayerLeave(p, common.PlayerLeaveReason_Bekickout, true)
|
||||
return true
|
||||
}
|
||||
|
@ -2460,6 +2465,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
playerEx.AddCoinNoLog(int64(-gainScore), 0)
|
||||
} else {
|
||||
playerEx.AddCoin(int64(-gainScore), common.GainWay_CoinSceneLost, 0, "system", s.GetSceneName())
|
||||
playerEx.Coin = 5
|
||||
}
|
||||
if sceneEx.IsRankMatch() {
|
||||
// 排位积分
|
||||
|
|
Loading…
Reference in New Issue