From cbb2e967642218f147eb6742a148b1be31990c27 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 19 May 2023 20:26:00 +0800 Subject: [PATCH] update --- modules/caravan/api_buyorsell.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index 44b35794e..1c6ddad83 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -50,15 +50,25 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe items := caravan.Items[k] var price int32 price = items.Price + bFound := false for _, v := range cityInfo.Special { if v == k { if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil { price = cityConf.Specialnum * price / 1000 + bFound = true } break } } - + if !bFound { + if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil { + for _, v := range cityConf.Exspecial { + if v == k { + price = cityConf.Exspecialnum * price / 1000 + } + } + } + } addScore += price * v // 卖出收益 } if this.module.ArrayBag(caravan, upperLimit) { // 背包满了