This commit is contained in:
meixiongfeng 2023-05-19 20:26:00 +08:00
parent a1f28a0ba6
commit cbb2e96764

View File

@ -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) { // 背包满了