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 {