From e5f3ee1c8b0fda20cc3a5ff73927394395e44b08 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 3 Nov 2022 15:06:25 +0800 Subject: [PATCH] bug --- modules/troll/module.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/troll/module.go b/modules/troll/module.go index a4405a94d..f3dd7c8d1 100644 --- a/modules/troll/module.go +++ b/modules/troll/module.go @@ -93,8 +93,8 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain, ai if coefficient == nil { return } - if troll.Sell >= coefficient.Coefficient { // 可以出售 - var preGold int32 + if troll.Sell <= coefficient.Coefficient { // 可以出售 + var preGold int32 // 成本价 for _, v := range goods { sellPrice[v.Id] = v.Goodsprice * coefficient.Coefficient / 1000 preGold += troll.Price[v.Id] * troll.Items[v.Id] @@ -112,8 +112,7 @@ func (this *Troll) TrollAI(session comm.IUserSession, troll *pb.DBTrollTrain, ai break } } - } - if troll.Buy >= coefficient.Coefficient { // 可以购买 + } else if troll.Buy >= coefficient.Coefficient { // 可以购买 for _, v := range goods { sellPrice[v.Id] = v.Goodsprice * coefficient.Coefficient / 1000 } @@ -180,7 +179,6 @@ func (this *Troll) BuyAllItem(uid string, troll *pb.DBTrollTrain, price map[int3 break } } - // 检查该位置的格子没有补满 full := (troll.Items[v.Id] + box[v.Id]) % maxgoods if full != 0 {