棋子商店bug修复

This commit is contained in:
hahwu 2025-09-19 17:32:16 +08:00
parent 4be34b276c
commit d7adfd557f
4 changed files with 47 additions and 10 deletions

View File

@ -275,6 +275,10 @@ func (p *Player) InitPlayer(UserName string) error {
// GoUtil.RegisterEvent(MergeConst.Notify_Midday_Renew, p.ZeroUpdate, p) // GoUtil.RegisterEvent(MergeConst.Notify_Midday_Renew, p.ZeroUpdate, p)
SyncFriendMsg(p) SyncFriendMsg(p)
p.UpdateUserInfo() p.UpdateUserInfo()
// fix bug
ChargeMod := p.PlayMod.getChargeMod()
ChessMod := p.PlayMod.getChessMod()
ChargeMod.FixBug(ChessMod.GetEmitList())
return nil return nil
} }
@ -310,7 +314,8 @@ func (p *Player) ZeroUpdate(a []interface{}) {
// 礼包充值 // 礼包充值
ChessMod := p.PlayMod.getChessMod() ChessMod := p.PlayMod.getChessMod()
p.PlayMod.getChargeMod().ZeroUpdate(ChessMod.GetEmitList()) ChargeMod := p.PlayMod.getChargeMod()
ChargeMod.ZeroUpdate(ChessMod.GetEmitList())
p.PushClientRes(p.PlayMod.getChargeMod().BackData()) p.PushClientRes(p.PlayMod.getChargeMod().BackData())
// 无尽礼包 // 无尽礼包

View File

@ -289,7 +289,9 @@ func UnitPlayroomOrder(p *Player) error {
} }
func UnitPetOrder(p *Player) error { func UnitPetOrder(p *Player) error {
p.FormatOrderReward() VarMod := p.PlayMod.getVarMod()
VarMod.DailyResetTime = 0
p.ZeroUpdate(nil)
return nil return nil
} }

View File

@ -132,6 +132,12 @@ func (c *ChargeMod) NoonUpdate(Emit []int) {
c.InitChessShop(Emit) c.InitChessShop(Emit)
} }
func (c *ChargeMod) FixBug(Emit []int) {
if len(c.ChessShop) < 6 {
c.InitChessShop(Emit)
}
}
// 充值 // 充值
func (c *ChargeMod) Fire(ChargeId int) (Item []*item.Item) { func (c *ChargeMod) Fire(ChargeId int) (Item []*item.Item) {
Money := chargeCfg.GetMoneyCharge(ChargeId) Money := chargeCfg.GetMoneyCharge(ChargeId)

View File

@ -194,14 +194,38 @@ func getChessLv(Min, Max, Diff int) int {
func getChessLvRange(Min, Max, Diff int) []int { func getChessLvRange(Min, Max, Diff int) []int {
Start := Min Start := Min
End := Max End := Max
switch Diff { if Max-Min >= 5 {
case DIFF_LOW: switch Diff {
End = Min + (Max-Min+1)/3 - 1 case DIFF_LOW:
case DIFF_MID: End = Min + (Max-Min+1)/3 - 1
Start = Min + (Max-Min+1)/3 case DIFF_MID:
End = Min + (Max-Min+1)/3*2 - 1 Start = Min + (Max-Min+1)/3
case DIFF_HIGH: End = Min + (Max-Min+1)/3*2 - 1
Start = Min + (Max-Min+1)/3*2 case DIFF_HIGH:
Start = Min + (Max-Min+1)/3*2
}
}
if Max-Min == 4 {
switch Diff {
case DIFF_LOW:
End = Min + 1
case DIFF_MID:
Start = Min + 2
End = Min + 3
case DIFF_HIGH:
Start = Min + 4
}
}
if Max-Min == 3 {
switch Diff {
case DIFF_LOW:
End = Min + 1
case DIFF_MID:
Start = Min + 2
End = Min + 2
case DIFF_HIGH:
Start = Min + 3
}
} }
Start = max(Min, Start) Start = max(Min, Start)
End = max(Start, End) End = max(Start, End)